2
$\begingroup$

If I have a rotation, $A$, and a translation, $B$, which I multiply like so

$C = AB$

Does the inverse of $C$ not only inverse the magnitudes of $A$ and $B$ but also become the reverse of operations?

e.g. $C^{-1} = BA$?

Does the inverse of a matrix also inverse the order of original operations (or am I conflating inverse with reverse)?

$\endgroup$
4
$\begingroup$

Yes. If you're compounding operations to make a matrix, then the inverse matrix will be the compound of the inverse operations, in the reverse order. So if $C = AB$ then $C^{-1} = B^{-1}A^{-1}$

Think of it geometrically. Taking a 2D example, if you have an object at the origin, and you want to move it +2 units in X then rotate around the origin by +45 degrees. To undo this transformation, you need to first rotate by -45 degrees then translate by -2 units in X.

$\endgroup$
  • $\begingroup$ Ah! I was thinking the inverse preserved original multiplication order so it effectively created a mirror transformation, but it doesn't. Does this explain why it works to use it as the view matrix - because any subsequent rotations of the camera will end up being done first, thus keeping an object in view? $\endgroup$ – SuperJumbo Feb 25 '18 at 21:14
  • $\begingroup$ No, the inverse undoes the original transform, so multiplying the two together will give you an identity matrix. Not quite sure what you're asking about the view matrix, but a view matrix in general is the inverse of the camera's transform - it moves the camera to the origin with no rotation. Applying this matrix to the other objects in your scene means that as your camera moves through the world, after applying your view matrix the camera is a fixed point, and the world is moving around it with the inverse motion. $\endgroup$ – russ Feb 26 '18 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.