It is a processing order. Imagine treasure hunt:
I) to the entrance of the garden head north
- go forward 10 steps
- head left
- go forward 5 steps
- head right
- go forward 7 steps
- dig a whole to get the treasure chest
Try to do that in a different order. It will not work. Imagine there are walls, holes, bridges doors. Just using different turn angels will produce different results.
There are other solutions that can be solved with the same steps (in other order) but most likely it does not work.
The trick with matrices is that you can express all these steps as matrix. The final result is a matrix again. This allows to combine the steps into a single matrix. Lets express the above example as matrices:
I) M0 = I [Identity matrix = no transformation]
- T10 = T(10,0,0) [Translation matrix go 10 steps along X]
- Rl = R(0,0,-90°) [Rotation along Z left)]
- T5 = T(5,0,0) [Translation matrix go 10 steps along X]
- Rr = R(0,0,90°) [Rotation along Z right)]
- T7 = T(7,0,0) [Translation matrix go 10 steps along X]
- done
The path is:
M0 * T10 * Rl * T5 * Rr * T7 = Mcombined
Now imagine you want to draw the character there. The character has 10.000 vertices. You would need calculate the above formula 10.000 times. As all vertices inherit the same transformation you can multiply the vertex position with the combined matrix Mcombined.
Vfinal = Vorignal * MFinal
now imagine your character turn left again (Rl). You could do
M0 * T10 * Rl * T5 * Rr * T7 * Rl = Mnext
or
you use the current transformation
Mcombined * Rl = Mnext
You do not need to remember all past steps as they are already in the combined matrix.
You place the character mesh at the new location with:
Vfinal = Vorignal * Mnext
A different example - Orbiting object:
- move the object at the orbit center (move left by radius r)
- turn the object by the desired angle a around Z
- move the object back to orbit (move right by radius r)
Matrix:
- Tc = Translation(0,r,0)
- Ra = Rotation(0,0,a)
- To = Translation(0,-r,0)
Tc * Ra * To = Mstep
You get an orbit animation by:
currentTransformation = currentTransformation * Mstep
draw Mesh
currentTransformation = currentTransformation * Mstep
draw Mesh
currentTransformation = currentTransformation * Mstep
draw Mesh
currentTransformation = currentTransformation * Mstep
draw Mesh
…
I hope this helps a bit