Imagination PowerVR SDK Blog

Can I use glTranslatef?


#1

to move the point/object in OGLES?

How to use that? Thanks.


#2

is there anyone who can answer me? Thanks a lot!


#3

You can update the model vertices before you pass them to the vertex shader - or better yet, update them in the vertex shader when setting the gl_Position variable. 


#4

Thanks, could you explain more specifically? how to write the shader to show glTranslate()? Thanks a lot!


#5

It’s all basic matrix math - maybe you should get a copy of the new OpenGL ES 2.0 book: 

http://www.amazon.com/OpenGL-ES-2-0-Programming-Guide/dp/0321502795/ref=pd_bbs_1

Is has some nice example code available at:
http://www.opengles-book.com/downloads.html

Unzip the example code and if you look at the Simple_VertexShader.c code in the Chapter_8 directory, you’ll see that uses its own internal ‘esTranslate()’ method to replicate the old ES 1.1 glTranslatef() functionality.  That should be about all you need.

  Adam


#6

Plus one recommendation for that book. It is a very nice book.

Even though it uses AMD emulator in the examples (same authors as of the book) and not PowerVRs (that i personally consider to be better documented and with a more rich feature set).