Suppose I want to perform translate in the following order:
- Scale by S
- Rotate by matrix R1
- Rotate by matrix R2
- Translate by T.
When I apply the matrix, should the overall transformation matrix be:
M = T x R1^-1 x R2^-1 x S
or
M = T x R2^-1 x R1^-1 x S
I always thought the transformations should be applied in reverse, so it should be the second case. But I'm told that it's the first case instead. Is there a special need to reverse the order of rotation apart from taking the inverse too?
Furthermore, why must I take the inverse matrix for rotation? Is there a particular formula for calculating the angle of rotation matrix as well?