View Full Version : help with using rotation

Runz W Scissorz
10-21-2004, 09:00 AM
im drawing what is supposed to be a sawblade in the middle of a factory. I want my sawblade to sit in the same spot and rotate in a circular fashion.

im using glRotatef(angle, x, y, z); this is all in 2D.

the problem is when i specify an angle and a z value, it moves around the screen. I want it to stay put, and rotate in place. how do i get it to do this?

(im also displaying linear movement in this picture, and it works fine (using glTranslatef(x,y,z). I am getting fustrated with trying to get rotate to work!)


10-21-2004, 09:04 PM
Hi !

An object is always rotated around the origin of the world (0,0,0) so if it is not there when you rotate it, then it will move.

How all this ends up depend on the order you do things (rotate,scale,translate) so it would help if you could post the code that does the transformation.