Why if we rotate an object by R and then translate it with T, from the object perspective, we're actually applying $-T$ and then $-R$

I've been introduced to local coordinates in contrast to the global ones which I was used to work on, where we have basically the camera at the origin.

For example, I've the following picture of a cube:

According to a slides that I've:

the object is rotated about the x-axis by $$R$$ and then translated by $$T$$

from the object's perspective, the world is first translated by $$–T$$ and then rotated about the (object's local) x-axis by $$–R$$

Not just the sign but also the order of the transformations changes. Why is that?

Note: I've some ideas, clearly, but I would like to hear a good answer with a mathematical explanation.

• Including your initial ideas may help people to tailor the explanation and highlight any misconceptions. Commented Oct 25, 2016 at 22:14

If you have object$\rightarrow$world space transformation matrix: $$M=T*R$$ then inverse (i.e. world$\rightarrow$object) of this transformation matrix is: $$M^{-1}=(T*R)^{-1}=R^{-1}*T^{-1}$$ So the order of multiplication of matrix inverses is reversed per matrix inversion rules.

The matrix contains a description to move form one space to another. The implied assumption is that there is some parent space which the matrix is defined in. There can be arbitrary chains of these parent child relationships. So you need to know the parent of the matrix.

The matrix multiplications $M \cdot \vec{v}$ describes the vector $\vec{v}$ in child space $M$ as seen by the parent space. The inverse $M^{-1} \cdot \vec{v}$ does the reverse of this it describes the vector in parent space in terms of child space coordinates.

So simply if you make a tree out of your parent child relationships when you move towards the root of your tree (World) you use non-inverted matrices, and when you move in the opposite direction (towards a leaf/child node) you take the inverse.

Why would you need the inverse? Well because you want to move two things independently of each other but still use the results in one space. For example imagine a world with one object and a camera. Its efficient to be able to model the camera separately. But then the vectors need to move form object space to camera space. So you take the object space move to world (moving towards root non inverted multiplication) and then you move that to camera space (move towards a child of world use inverse) so you get:

$$T_{camera}^{-1} \cdot (T_{object} \cdot \vec{v}) = T_{camera}^{-1} \cdot T_{object} \cdot \vec{v}$$

(Please note that matrix multiplication order depends on whether you define vector as row or column matrices. Both are fine mathematically as is storing the sub vectors in arbitrary order inside the matrix)