Jump to content

  • Log In with Google      Sign In   
  • Create Account

Matrix Stack & New OpenGL Standards


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 TRONJon   Members   -  Reputation: 223

Like
0Likes
Like

Posted 06 March 2014 - 02:48 AM

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



Sponsor:

#2 Brother Bob   Moderators   -  Reputation: 8251

Like
3Likes
Like

Posted 06 March 2014 - 02:58 AM

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.



#3 Hodgman   Moderators   -  Reputation: 30432

Like
2Likes
Like

Posted 06 March 2014 - 03:00 AM


...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



#4 3TATUK2   Members   -  Reputation: 730

Like
1Likes
Like

Posted 06 March 2014 - 03:22 AM

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.



#5 TheChubu   Crossbones+   -  Reputation: 4420

Like
1Likes
Like

Posted 06 March 2014 - 03:28 AM

 


...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


#6 Hodgman   Moderators   -  Reputation: 30432

Like
1Likes
Like

Posted 07 March 2014 - 06:38 PM


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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS