Game Development Reference
In-Depth Information
How pivot point locations affect the animation
Parent objects are important in the way that a complex set of geometry is
animated and deformed. Another important consideration is the location
around which the object rotates. By default, an object rotates about the
origin {0.0, 0.0, 0.0}. But we may wish an object to rotate about another
location. See Figure 7.6 to see how the pivot point of an object influences
how a 30° rotation of the pitch affects the object's position with respect to
its parent. Rotating the calf with the pivot at the ankle has an undesirable
effect of distorting the thigh.
Figure 7.6 The effect of varying the pivot location of an object.
To ensure that a child object is located in the correct position and
orientation with respect to its parent, we must first ensure that its pivot
point is in the correct location. Then we must rotate and transform the
pivot point location using the parent's transformation matrix. The rotation
matrix for the parent must have been previously calculated and stored in
the m_right , m_up and m_forward member variables of the parent object.
Each of these member variables is a VECTOR, the declaration of which
is shown in the code segment below. The rotation matrix is
Rx
Ux
Fx
x
y
z
M =
v =
Ry
Uy
Fy
Rz
Uz
Fz
where R is shorthand for m_right , U is shorthand for m_up and F relates
to m_forward .
Search Nedrilad ::




Custom Search