858 Chapter 18 Object-Oriented Infrastructure
rotation about the direction vector, yaw is rotation about the up vector, and pitch is
rotation about the right vector. Let Q be the rotation matrix about one of these axes
by a predetermined angle. If R is the object’s local rotation matrix, then the update
of the local rotation matrix is R ← QR. If the object is the root of the scene, the
world rotation matrix is the identity matrix. Column 0 is (1, 0, 0) and is the direction
vector, column 2 is (0, 1, 0) and is the up vector, and column 2 is (0, 0, 1) and is the
right vector. The incremental rotation matrix Q is computed using these axes and the
predetermined angle.
To rotate the object via keyboard events, a mechanism similar to camera motion is
used. ...