Matrix
multiplication does not commute. What
happens if matrix transformations are applied in the wrong order?
The
transformed object can be (and
often is) at a different (incorrect) location.
Experiment:
Transformation 1 vs. Transformation 2
Transformation 1
- Rotate 90 degrees about y
- Translate 1 unit along z
M.Translate(glm::vec3(0.0f,
0.0f, 1.0f));M.Rotate(glm::vec3(0.0f,
1.0f, 0.0f), 90.0f);RenderPerson();Transformation 2
-
Translate 1 unit along z
- Rotate 90 degrees about y
M.Rotate(glm::vec3(0.0f,
1.0f, 0.0f), 90.0f);M.Translate(glm::vec3(0.0f,
0.0f, 1.0f));RenderPerson();

One
must think carefully about the sequence of transformations applied to an object