Matrix Problems

I’m writing a program that will load a scene from a certain format and display it using OpenGL. However, the file format uses a different type of cordinent (sp?) system than OpenGL. For instance, if the file says to translate (1, 0, 1), I have to invert the Z axis and do glTranslate(1,0,-1). This works fine. Scaling works fine. However, if the file says to do a Rotate (36.0, 1.0, 1.0, 1.0), I have found that I need to do glRotate(-36.0, 1.0, 1.0, -1.0).

So far this code is working fine. However, sometimes the file will specify it’s own transformation matrix. How do I modify the matrix? I know that the 14th element is the z translation variable, and so it needs to be modified (-matrix[14]), but what about the rotation? What elements of the array do I invert for that?


Sounds to me that all you have to do is invert the foward vector of the matrix. It must be using a left handed coordinate system like d3d. So index 2,6,10 of the matrix has to be inverted to flip it 180 degrees. Try that man.