View Full Version : inverse modelview matrix

10-13-2004, 10:00 AM
I'm sure this has been posted before:

anyone know a quick way to get the inverse modelview matrix?

is the only way to do a glGetDoublev() and then run the modelview through my own function to retrieve the inverse?


10-15-2004, 03:50 PM
If you are doing something like billboarding and you have only isotropic scaling, you can cheat by looking at the transpose of the MVM. Check out this: http://www.lighthouse3d.com/opengl/billboarding/index.php3?billInt

10-16-2004, 09:38 AM
It's not quite as simple as just the transpose; that only covers rotation. For a rotation-and-translation MVM you need to:

a) transpose the rotational basis; that's the upper-left 3x3 submatrix

b) negate the translation vector; the first 3 numbers in the 4th row (or column, depending on your notation)

c) multiply the negated vector by the transposed basis

Still a lot simpler than a full inverse function for an arbitrary 4x4 matrix. For most apps, you'll never need such a thing.

10-16-2004, 12:14 PM
However, if you really need the inverse, here is some info, how to do that (itīs very easy, in fact):

Link (http://skal.planet-d.net/demo/matrixfaq.htm#Q21)