// JP opened flex table

Click to See Complete Forum and Search --> : Extracting the pure world transformation from the Opengl modelview matrix


Zen42
May 11th, 2008, 05:55 PM
#
I'm having a serious problem in OpenGL. Basically, I'm trying to extract the equivalent of DirectX's World Matrix from OpenGL's ModelView matrix. Now, I'm trying to do this by calculating what should be the inverse of the 'view matrix' and multiplying the modelview matrix by it to get the pure world transformation. So. If pos, look, up and right are the eye position and relevent vectors of the camera, would, or would not, the right way of calculating the inverse of the view matrix be as follows?:

right.x, right.y, right.z, 0

,up.x, up.y, up.z, 0

,look.x, look.y, look.z, 0

,pos.x, pos.y, pos.z, 1" ?

I WOULD just track the world transformation myself, but...well, I can't, unless I'm missing something really obvious. I'm using an API provided to me by a lecturer, which I have to use for the project I'm doing. It's scenegraph-based. The reason I want to calculate the the current world transformation is so I can stick the object which does so somewhere in the scenegraph tree and have it report the world transformation there. This is mostly for use as an emitter for a particle system, establishing where the particles should spawn.

//JP added flex table