Creating matrix representations of affine transformations
In Chapter 12, Mastering Affine Transformations, we examined numerous techniques for repositioning and resizing vertices and meshes. The mathematics involved, except for rotations, was mostly straightforward. For these formulae, we applied straightforward arithmetic and some trigonometry to build up equations. Would it surprise you to know that you can represent these transformations as matrix operations? In this section, I will reveal how this can be achieved.
Moving from linear equations to matrix operations
Let’s remind ourselves of the formulae used for the most popular of the affine transformations – translation, scaling, and rotation. The point, Q, can be translated by adding a translation value, T, to each of its coordinates, resulting in a new point, P:
P(x, y, z) = T(x, y, z) + Q(x, y, z)
We can turn this into a matrix addition operation like so:
If you are thinking that I’ve...