Rotating points around a pivot
Right now, you are probably feeling pretty comfortable with affine transformations. There’s no doubt that scaling and translation are simple concepts. But now, we move on to rotations. Hold on to your hat because the mathematics is about to go up a few notches in complexity.
Just as translation and scaling in 3D work with each of the x, y, and z axes, so too does rotation. An object can rotate around its x, y, or z axis. These rotations are illustrated in Figure 12.6:
Figure 12.6: A teapot rotated around each axis
What makes the calculations for each of these rotations more difficult than scaling and translation is that while the x, y, and z values applied in scaling and translation only affect their coordinate counterparts (for example, x affects x, y affects y, and likewise), with rotations, to rotate around one axis, the other two axes are involved. The following equations use what are called Euler angles. These...