Combining transformation matrices for complex maneuvers
As with the OpenGL order of transformations, which we discussed in Chapter 12, Mastering Affine Transformations, when combining these homogeneous representation matrices to produce compound movements involving translation, scaling, and rotation, the matrices are presented in reverse order. For example, to transform a point by (3, 4, 5), rotate it around the X-axis by 45 degrees, and then scale it by 0.3 in all directions; the matrix multiplication is as follows:
Note how the translation matrix of the first operation is placed on the right and the scaling matrix on the left. To multiply this out, we begin by multiplying the last two matrices (the translation and rotation) to get the following:
Then, we complete the multiplication with the remaining two matrices, which results in the following:
Although learning to calculate these operations by hand is a great skill to have and will help embed your understanding...