Sign in to follow this  

OpenGL Drawing to a Position

Recommended Posts


I've just begun learning about OpenGL ES 2.0. I've used OpenGL a little with the standard pipeline before, but I'm struggling with a few things.

Before when I've wanted to draw an object at a specific position (say player model at player position) I'd push the matrix, glTranslatef and then pop it afterwards.

However ES 2.0 deprecated Push and PopMatrix.

So what would be the generally accepted best way of doing this now?

Thanks in advance, all help appreciated.

Share this post

Link to post
Share on other sites
ES 2.0 deprecates not only Push and PopMatrix, but the fixed pipeline as a whole. Thus, you should write shaders and perform all the transformations by yourself. So there are no actual commands that "replace" matrix stack operations: you just pass any needed matrices to shaders and use them there accordingly. Therefore, if you still for some reason need a stack, you'd have to implement it yourself.

Generally, you'd be better off reading the GLES spec (and a GLSL ES spec) for better view of the action. And you can find plenty of examples for programmable pipeline out there on the net (like [url=",_VBOs,_Vertex_and_Fragment_Shaders_(C_/_SDL)"]this one[/url]).

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this