i’ve just started to progam with opengl and i’ve a little problem with glTranslatef().
glTranslatef(x,y,z);
when i use x and y it’s moving well on right and up but when i try to move with z the TRIANGLE that i’ve made disappears
anyone know why and can help me ?
sorry for my bad english i’m french.
i’m using dev-cpp.
Thanks a lot.
You make a typical mistake : You don’t watch your matrices!
Things like gluPerspective have to be put into the (guess what) Projection-Matrix, whereas your drawing-calls go into the Modelview-Matrix.
Your code should look like this :