Abbas Mohammed
Abbas Mohammed

Reputation: 25

openGL, the inverse of the transformations

If I have 3 different matrices, one for rotation (R), one for translation(T), and one for scaling (S), how to achieve the reverse effect of these matrices by manipulating the one caused it?

What I gathered so far is if I transposed the rotation matrix, I will achieve what I desire (is this correct?). And what about the other two? And if there is a common way, are there any special cases where these ways will not suffice?

Upvotes: 0

Views: 1084

Answers (1)

John Alexiou
John Alexiou

Reputation: 29264

The inverse of the rotation matrix R is indeed its transpose RT.

The inverse of the scaling matrix S is easy as it contains only diagonal elements (the first three rows, as the last row is always equals to (0 0 0 1))

So you just replace each diagonal si with 1/si.

Finally the translation matrix T is an identity matrix with the translation vector on the last column. The inverse is achieved by replacing those elements with their negative.

Also the inverse of the product of 3 matrices, is the reverse product

(S T R)-1 = R-1 T-1 S-1

Upvotes: 2

Related Questions