Matrix Stack & New OpenGL Standards

Started by
4 comments, last by Hodgman 10 years, 1 month ago

Hey everyone, I'm new to these forums... so please be gentle! :)

I'm just wondering if anyone has put thought towards / knows the solution to displaylists with the new openGL standards coming up in future versions.

What I mean is, currently we use glTranslate and glRotate etc when positioning our camera in 3D space... but I personally also use them when rendering geometry into a display list.

If perfectly at peace with losing these functions and working out our own custom matrices... but what if we need to modify the matrix during a list call? displaylists will only store openGL commands, ignoring my own matrix modifications?

Is the solution simply to make sure that calls to glVertex3f() are already transformed within the geometry without using a matrix within the displaylist?

Jon

Advertisement

If you are worried about losing the matrix functions in the new versions, then you are also losing display lists and immediate mode rendering at the same time. Vertex arrays and shaders are the only way forward in the new versions. Also, this is not really new. The new API which dropped all the old stuff was released nearly six years ago.

Moving the thread from coding horrors as well, this is clearly and OpenGL topic.


...with the new openGL standards coming up in future versions ...currently we use glTranslate, glRotate, glVertex3f...
This future version arrived in 2004! ph34r.png

Since then, the process has been to copy your final matrix values into a uniform variable directly before drawing the object.

If your code is based around pre-2004 OpenGL, such as glTranslate, glRotate, glVertex3f... then I would just keep going as you are!

You'd basically want to start from scratch if you wanted to start using modern OpenGL tongue.png

Basically it boils down to replicating the same functions. Either with something like GLM, some other, or hand-rolled. And then passing to shader via uniform like Hodgman mentioned.


...with the new openGL standards coming up in future versions ...currently we use glTranslate, glRotate, glVertex3f...
This future version arrived in 2004! ph34r.png

Are we talking about OpenGL 3? OpenGL 3 came out in 2008.


but what if we need to modify the matrix during a list call?

You're already using deprecated code in either a very old context or a newer context on compatibility profile, which also has matrix functions.

If you drop "dreprecated" functionality, you drop all of it in a core context, glBegin/End, gl matrix, client states, display lists, all of it.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator


Are we talking about OpenGL 3? OpenGL 3 came out in 2008.
I was suggesting that by GL2, all the functions in the OP had been replaced with modern alternatives wink.png

This topic is closed to new replies.

Advertisement