Game Development Reference
In-Depth Information
Figure 12.4: Pitch, or rotation about
the camera's right vector
Figure 12.5: Yaw, or rotation about
the camera's up vector
Figure 12.6: Roll, or rotation about
the camera's look vector
We see that when we pitch, we need to rotate the up and look vectors
around the right vector by the specified rotation angle. Similarly, we
see that when we yaw, we need to rotate the look and right vectors
around the up vector by the specified rotation angle. Finally, we see
that when we roll, we need to rotate the up and right vectors around
the look vector by the specified rotation angle.
We now see why the D3DXMatrixRotationAxis function is nec-
essary, as any of these three vectors that we rotate around may have an
arbitrary orientation in the world.
The implementations for the pitch, yaw, and roll methods follow
what we have just discussed. However, there are some restrictions that
we make for LANDOBJECT s. In particular, it doesn't look and feel right
for a land object to yaw when tilted or for it to roll. Therefore, for
LANDOBJECT s we rotate around the world's y-axis rather than the
Search WWH ::




Custom Search