Game Development Reference
In-Depth Information
the origin. Rotation about the origin is a linear transform, but rotation
about any other point is an a ne transform. As we show in Section 6.4.3,
to perform an a ne transformation, we compose a sequence of primitive
operations. For rotation about an arbitrary point, we translate the cen-
ter of rotation to the origin, rotate about the origin, and then trans-
late back. In other words, if we want to move the robot into place by
translating first and rotating second, we likely go through the following
process:
1. Translate.
Translating first and
then rotating
2. Rotate. Because we're rotating about a point that's not the origin,
this is a three step process:
a. Translate the center of rotation to the origin. (This undoes
step 1.)
b. Perform the rotation about the origin.
c. Translate to put the center of rotation in place.
Notice that steps 1 and 2a cancel each other out, and we're left with the
two steps: rotate first, then translate.
So we've managed to get the robot model into the right place in the
world. But to render it, we need to transform the vertices of the model
into camera space. In other words, we need to express the coordinates of
the vertices relative to the camera. For example, if a vertex is 9 ft in front
of the camera and 3 ft to the right, then the z- and x-coordinates of that
vertex in camera space would be 9 and 3, respectively. Figure 3.8 shows a
Overhead view
Camera's view
Figure 3.8
The layout of the camera and robot in the scene
Search WWH ::




Custom Search