Graphics Reference
In-Depth Information
y
Y
X
x
z
Z
FIGURE 2.9
Global coordinate system and unit coordinate system to be transformed.
An alternative way to represent a transformation to a desired orientation is to construct what is
known as the matrix of direction cosines . Consider transforming a copy of the global coordinate system
so that it coincides with a desired orientation defined by a unit coordinate system (see Figure 2.9 ) . To
construct this matrix, note that the transformation matrix, M , should do the following: map a unit x -axis
vector into the X -axis of the desired orientation, map a unit y -axis vector into the Y -axis of the desired
orientation, and map a unit z -axis vector into the Z -axis of the desired orientation (see Eq. 2.18 ). These
three mappings can be assembled into one matrix expression that defines the matrix M (Eq. 2.19) .
X ¼ Mx
Y ¼ My
Z ¼ Mz
2
3
2
3
2
3
2
3
2
3
2
3
X x
X y
X z
1
0
0
Y x
Y y
Y z
0
1
0
Z x
Z y
Z z
0
0
1
(2.18)
4
5 ¼ M
4
5
4
5 ¼ M
4
5
4
5 ¼ M
4
5
2
3
2
3
X x Y x Z x
X y Y y Z y
X z
100
010
001
4
5 ¼ M
4
5 ¼ M
(2.19)
Y z
Z z
Since a unit x -vector ( y -vector, z -vector) multiplied by a transformation matrix will replicate the
values in the first (second, third) column of the transformation matrix, the columns of the transforma-
tion matrix can be filled with the coordinates of the desired transformed coordinate system. Thus, the
first column of the transformation matrix becomes the desired X -axis as described by its x -, y -, and
z -coordinates in the global space, call it u ; the second column becomes the desired Y -axis, call it v ;
and the third column becomes the desired Z -axis, call it w (Eq. 2.20) . The name matrix of direction
cosines is derived from the fact that the coordinates of a desired axis in terms of the global coordinate
system are the cosines of the angles made by the desired axis with each of the global axes.
In the example of transforming the aircraft, the desired Z -axis is the desired orientation vector,
w ¼
4, 5]. With the assumption that there is no longitudinal rotation (roll), the desired X -axis
can be formed by taking the cross-product of the original y -axis and the desired Z -axis, u ¼
[3,
3].
The desired Y -axis can then be formed by taking the cross-product of the desired Z -axis and the desired
X -axis, v ¼
[5, 0,
[12, 34, 20]. Each of these is normalized by dividing by its length to form unit vectors. This
 
Search WWH ::




Custom Search