Graphics Reference
In-Depth Information
y
y
x
x
Up vector
z
z
(23, - 14, 40)
(20, -10, 35)
World space position and
orientation of aircraft
Object space definition
FIGURE 2.6
Desired position and orientation.
The task is to determine the series of transformations that takes the aircraft from its original object
space definition to its desired position and orientation in world space. This series of transformations
will be one or more rotations about the principal axes followed by a translation of (20,
10, 35). The
rotations will transform the aircraft to an orientation so that, with its center at the origin, its nose is
oriented toward (23
20,
14
þ
10, 40
35)
¼
(3,
4, 5); this will be referred to as the aircraft's
desired orientation vector.
In general, any such orientation can be effected by a rotation about the z -axis to tilt the object,
followed by a rotation about the x -axis to tip the nose up or down, followed by a rotation about the
y -axis to swing the plane around to point to the correct direction. This sequence is not unique; others
could be constructed as well.
In this particular example, there is no tilt necessary because the desired up vector is already in the
plane of the y -axis and orientation vector. We need to determine the x -axis rotation that will dip the nose
down the right amount and the y -axis rotation that will swing it around the right amount. We do this by
looking at the transformations needed to take the plane's initial orientation in object space aligned with
the z -axis to its desired orientation.
The transformation that takes the aircraft to its desired orientation can be formed by determining
the sines and cosines necessary for the x -axis and y -axis rotation matrices. Note that the length of the
q
3 2
5 p . In first considering the x -axis rotation, initially posi-
tion the orientation vector along the z -axis so that its endpoint is at (0, 0,
2
5 2
orientation vector is
þð
4
Þ
þ
¼
5 p ). The x -axis rotation must
4in y . By the Pythagorean Rule, the
rotate the endpoint of the orientation vector so that it is
p
50
3 p after the rotation. The sines and cosines
can be read from the triangle formed by the rotated orientation vector, the vertical line segment
that extends from the end of the orientation vector up to intersect the x-z plane, and the line segment
from that intersection point to the origin ( Figure 2.7 ) . Observing that a positive x -axis rotation will
4 2
z -coordinate of the endpoint would then be
¼
 
Search WWH ::




Custom Search