PDA

View Full Version : Inverse matrix



vlada
03-11-2005, 10:29 AM
Is there a way to get inverse of GL_MODELVIEW_MATRIX? I am certain hardware has to use it at some point, and I can't believe it has been excluded from the API??

So I am looking for something like glGetFloatv(GL_MODELVIEW_INVERSE_MATRIX) ...

I went through RedBook couple times, but I couldn't find it, am I blind or.. ??

Thanks for help in advance :)

dvm
03-11-2005, 10:51 PM
I'm not putting my hand on fire over this, but I don't think it exists. Besides, I don't think it's that hard to write your own inverse routine. You can get the current matrix with:

GLdouble modelviewMatrix[16];
glGetDoublev(GL_MODELVIEW_MATRIX, modelviewMatrix);Same, for projection and texture.

vlada
03-11-2005, 11:25 PM
It is not hard at all, but finding inverse matrix in general can be quite costly, since it involves lots of multiplications. :(

I just can't believe it doesen't exist as part of API. :( ( Oh, well... I guess transposing and translating will have to cut it. :p

uruk
03-14-2005, 12:42 PM
Check this (http://cache-www.intel.com/cd/00/00/01/76/17670_24504501.pdf) out. It's from Intel's site and I think you'll find it very interesting.

Luminous Blue
03-16-2005, 05:32 PM
Take a look at:

cheating inverse

http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=2;t=018093