Graphics Reference
In-Depth Information
Figure 8.2. Several example model rotations are shown. Many combinations are possible, such as rotation
about the x -axis (left), the y -axis (middle), or both (right). Model courtesy of Radioactive Software, LLC,
www.radioactive-software.com . Created by Tomas Drinovsky, Danny Green.
In some cases, you would restrict one or more of the potential rotations, such as the cam-
era orientation in a first person shooter (FPS) game that doesn't allow rotation about the Z axis.
However, it is generally possible for the objects in a scene will allow rotations about all three
axes. Several examples of rotations being applied to a model are shown in Figure 8.2.
Translation matrices. Finally, the position of the model within our scene can be manipu-
lated with a translation matrix. This matrix is used to move an object from one location to
another, without modifying the other properties discussed above. The method for creating
a translation matrix is shown in Equation (8.3):
(8.3)
The translation matrix is arguably the simplest of the three operations, and it is very
intuitive to consider the results of a translation operation. Several examples are provided
in Figure 8.3.
Figure 8.3. Several model translations, including movement along the x-axis (middle) and the x- and y -axes
(right).
Search WWH ::




Custom Search