A SERVICE OF

logo

Transforming Shapes to New Locations, Sizes, and Orientations
81
Figure 6-2 Scaling in Different Orientations
All of these methods invisibly set a transformation matrix to carry out their actions. If
you want to set the matrix directly, you can use the setMatrix() method.
Ordering Transformations
The order in which you perform transformations can effect the nal result. Take, for
example, translating and rotating a model. If you perform the transformations in this
order, you end up with a rotated model translated, for example, down the X axis, as
shown in Figure 6-3.
Figure 6-3 Order of Transformations
x
z
y
x
z
y
x
y
1-Rotate
2-Translate
x
y
2-Rotate
1-Translate