Archived

This topic is now archived and is closed to further replies.

p4n1c

glLoadMatrix

Recommended Posts

I created a 3D math library back in the day(1999), and real life got in the way and I gave up 3D, while I''m trying to get back into it now with OpenGL and wondering if I would still be able to use all my matrix and vector calculation functions with OpenGL. I used 4x4 matrices in my library, would I just use glLoadMatrix after doing my calculations? Thanks in advance for any replies.

Share this post


Link to post
Share on other sites
Yes, the only thing you have to worry about is that eventually you have to transpose you matrices before sending them to opengl (depending on how your lib works).

For this you can either manually transpose you matrices or use
glLoadTransposeMatrix (core OpenGL 1.3)

-Lev

Share this post


Link to post
Share on other sites
How do I use the OpenGL 1.3 functions?

My rotations work, but the object stays in one place on the screen no matter where you translate it too. Would I have to combine both the Modelview matrix and my matrix together?

Share this post


Link to post
Share on other sites
quote:
Original post by p4n1c
How do I use the OpenGL 1.3 functions?



I assume you have windows. You could manually load new functions using the extension mechanism of opengl. Or you could use my extension loading library that does it for you:
http://www.uni-karlsruhe.de/~uli2

quote:

My rotations work, but the object stays in one place on the screen no matter where you translate it too. Would I have to combine both the Modelview matrix and my matrix together?



The translation must be applied last. i.e. if you have a rotation matrix R and a translation matrix T your final matrix should be R*T.

using T*R will discard your translation.

-Lev

Share this post


Link to post
Share on other sites
Works now. Thanks.

Only thing I have to do now is fix the jumpiness whenever the x, y and z rotation angles are different from each other.

Share this post


Link to post
Share on other sites