hi im moving a cube from y=0 to y=10 usualy when the cube is on y=10 i want it to go back to 0 but if i do gltranslatef(0,0,0) it doesnt go back to 0 it just doesnt do anithing i dunno why
if i do sumthing like gltranslatef(0,-10,0) then it goes back to 0 but this is lame!!
That’s one way, but could accumulate errors.
The nicer way is to do
// Assuming glMatrixMode(GL_MODELVIEW) is active
glTranslatef(0.0f, 10.0f, 0.0f);
No chance to accumulate errors here and the push and pop operations should be quicker than matrix manipulations.
If you have a deep hierarchy you need to check the maximum matrix stack size of the different matrix modes with glGetInteger().
thx! im doing that now but it still keep on going up doesnt go back to 0 i wonder what culd be wrong???