# Fast Inverse

This topic is 4855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi guys. What is the fastest way for find a 3D transform inverse? Such transform is a 4x4 matrix that manages rotations and translations. And, what about if it contains scale too?

##### Share on other sites
If you know how the transformation matrix was constructed, you can avoid a general inverse by constructing it in 'reverse'. If the original matrix is (using column vectors):

M = T*R*S

Where T = translation, R = rotation, and S = scale, the inverse is:

M-1 = S-1*R-1*T-1

Each of the inverses on the right has a trivial form (ask if you're not sure what they are). If you really want to optimize, you can write a special function to take advantage of all the zero entries.

If you just have a 4x4 transformation matrix, you can always decompose it into a translation matrix T, and a linear transform, call it L. Then:

M-1 = L-1*T-1

If you know that L only contains rotation, you can just invert it by transposition. Otherwise you'll need a general inverse, but only of the 3x3 linear transform, which is cheaper than a full 4x4 inverse.

[Edit: fixed as per b34r's post.]

[Edited by - jyk on July 1, 2005 7:51:01 AM]

##### Share on other sites
Quote:
 Original post by jykIf you know that L only contains rotation and perhaps uniform scaling, you can just invert it by transposition. Otherwise you'll need a general inverse, but only of the 3x3 linear transform, which is cheaper than a full 4x4 inverse.

Yes, although transposition will only work for a non-scaling rotation matrix.
You can get the scale vector out of the 3x3 matrix by getting the length of each row vector (if you're using row major matrice), from there it's easy to inverse scale aswel.

1. 1
2. 2
3. 3
Rutin
17
4. 4
5. 5

• 14
• 9
• 9
• 9
• 10
• ### Forum Statistics

• Total Topics
632912
• Total Posts
3009185
• ### Who's Online (See full list)

There are no registered users currently online

×