Jump to content
  • Advertisement
Sign in to follow this  
ernii

OpenGL Manipulating the modelview matrix between glBegin and glEnd

This topic is 4757 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I know that something like that glBegin(GL_QUADS); glVertex(..); glRotated(...); glVertex(); glEnd(); ist not allowed (has no effect) in OpenGL but is there an easy way to do something similar with OpenGl extensions? I've heared that Vertex Shader have only information about the Vertex himself, so it would not be easy to pass the parameters to the Vertex for manipulation .... cu ernii

Share this post


Link to post
Share on other sites
Advertisement
No, there really isn't a way to do that. Just close off the statement with glEnd, make your change, then start up a new set with glBegin.

It's done this way for efficiency. Between a glBegin/glEnd, a driver knows it won't have to worry about anything other than vertex data, which allows it to cut out a lot of code per procedure call (which is important, because you're probably calling glVertex and friends a great number of times). Most drivers will not submit any of your vertices until glEnd is called, at which point it can set up the OpenGL state once, and render everything very quickly.

If you would be willing to share what your end goal is, perhaps we can suggest a higher-performing alternative (since glBegin/glVertex/glEnd is a very slow way to render).

Share this post


Link to post
Share on other sites
Hi

There is no realy a goal for that, it's more out of couriosity...
Originally I had bones in mind, but I implemented the bones now, calculating the vertices myself and drawing via glDrawElements.

However I was wandering if there is a method for transforming each vertex individually via opengl.
Since I was told that Vertex Shader only have acces to local parameters of the Vertex (position,normal,color,texture coordinates) and opengl states it seems difficult to control how the transformation should be...
on the other hand I've never used an opengl extension and there are just so much of them maybe there is an easy way for something like this..

cu
ernii

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!