View Full Version : Using OpenGL with your own Matrices

11-14-2002, 05:00 PM

Is there a way to completely use ONLY your own matrices in OpenGL ?
I'm using OpenGL with C++, and I am implementing my own matrix class. I will load an object and then do various transitions with it using my own matrices and my own matrix multiplication/etc. routines.
I looked on the web, and there is to specify your own matrices, but I haven't found a good source.

So, the thing I need to know is: is there a way to completely avoid OpenGL's matrix operations and use your own ?


11-14-2002, 05:04 PM
you could just set both modelview and projection matricies to the identity and ignore them.

11-14-2002, 05:09 PM

but is there a way to use your own matrix with openGL ?
Suppose, I have this:
double array[4][4]; //which is my own matrix for rotation for example.

Can I integrate it with OpenGL somehow, so after I apply it, the object is rotated ?


11-14-2002, 08:14 PM
In the Red book,they mention that
glLoadMatrix*() and glMultMatrix*()
allow you to specify any transformation matrix directly and then to multiply the current matrix by that specified matrix.
Might be what you're looking for.

The other way would be to apply the matrix
yourself to each vertex before drawing.

Hope this helps.


11-14-2002, 09:22 PM
thanks !

I figured it out ! those were the commands I was looking for.

However, you got me interested -- how do I apply
How can I apply a matrix to each vertice before drawing ?
I'll need that too, since I will need to draw an object, but before I'll draw it I'll need to transform it ..


11-14-2002, 09:51 PM
If you want to do your own transformation just set the modelview and projection to identity.

Then you can transform your vec4s in software yourself and send the results to the pipe in the usual way.

11-17-2002, 03:26 AM
There is a tut/demo of how to do this at http://www.mfcogl.com/

See OpenGL Topics, Rotate (Cylinder) Yourself. It is in MFC but the math and OpenGL is the same.