problem with rotation

Hi to everybody,

I am new to opengl.I find it difficult and I am comfused.
To begin with,I have already drawn a cube.I used the keys(W,S,A,D) in order to move
the cube forward,back,left,right.Until now,all OK!Then I tried to use the rotation command,glRotate and finally I managed to rotate the cube.But,everytime I try to move the cube(with the above keys),after having rotated the cube,the coordination system had moved.So when i try ,for example,to go forward the cube goes to different direction each time depending on the previous rotation.What can I do?

It is all a question on the order, glTranslate followed by glRotate is not the same thing as glRotate followed by glTranslate.

Have a peek at some OpenGL tutorials on transformations, that might clear things up a bit for you.

check out my tutorial on this at: