PDA

View Full Version : problem with rotation



03-07-2005, 11:59 PM
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?
Thanks.

mikael_aronsson
03-08-2005, 01:03 AM
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.

03-08-2005, 07:25 PM
check out my tutorial on this at:

http://developer.nomadph.com/part13.html