Geometry can be transformed in three ways: by scaling it, by rotating it, and by translating it. In graphics, these three transformations are each represented by a transformation matrix.

Relative to the world origin

A transformation is applied to a geometry relative to the world origin.

I often want some geometry to rotate or scale about itself, but this requires it to be located at the world origin. Basically, I mistakenly assume the transformation matrix applies in the object’s local space, but it does not.

Multiplying transformation matrices

One way to think about applying many transformations onto some geometry is that they all “don’t know” about each other. So picking the right transformation application order is important. This is because matrix multiplication is non-commutative.

Chaining transformations

The “least destructive” way of ordering transformations is the following:

This assumes that at first, all your geometry is located at the world origin. And then, you wish to correctly scale and rotate it before translating it to its correct position in World space.

Think of the order in which transformations are applied as right to left. Therefore, the geometry that you’re trying to manipulate is on the rightmost end of the chain.