2.2.4 Coordinate Transformation of Objects
A point only includes positional data while an object includes both positional and orientational data in space. In addition, it may be convenient to represent the position and orientation by a local coordinate system (LCS) attached to an object. Figure 2.9 shows such a CS, which is called an object coordinate system (Ob − XbYbZb).
Figure 2.9 Object coordinate system in a world coordinate system.
In Figure 2.9, a reference origin
(2.4)
where [T]4 × 4 is the homogenous matrix for the representation of an object CS {Ob − XbYbZb} in the world coordinate system (Ow − XwYwZw).
Note that the homogenous matrix in Eq. (2.4) includes six independent variables: three for the position and the rest for the orientation.
A homogenous transformation matrix can be generalized to deal with any transformation of objects in a coordinate system. Figure 2.10 shows the generalized matrix of homogeneous transformation. The elements of the matrix in different fields affect the transformation of an object in different ways. For examples, the elements (a, e, j) scale the coordinates of x, y, and z, the elements (p, q, r) translate the coordinates of x, y, and z, and the element s gives an overall inverse scale of the object.
Figure 2.10 Impacts of elements in a generalized homogeneous matrix.
The generic homogeneous matrix [T]G can be customized to implement some common coordinate transformations of an object. For example, the translation matrix [T]TR of an object can be simplified as
(2.5)
where [T]TR is the 3D translation matrix and p, q, r are the translational distances of a point from its original position along the x, y, and z axes, respectively.
The scaling matrix [T]SC of a 3D object can be defined as
(2.6)
where [T]SC is the 3D scaling matrix and a, e, j are the scaling factors along the x, y, and z axes, respectively.
Example 2.1
Given a cube with the size of 1 × 1 × 1 at its origin in Figure 2.11, determine the vertices of the object after the lengths along the x, y, z axes are scaled up by 2, 3, and 1, respectively.
Figure 2.11 Example of a scaling matrix of a 3D object.