Advertisement

Rotating around an objects origin

Started by July 10, 2000 06:00 PM
1 comment, last by steve_bruce 24 years, 4 months ago
I''m trying to rotate a single quad around the Y axis so it spins on it''s center of origin. However it doesn''t it does a little orbit around a different origin. How do I fix/stop this and and return the center of origin to the center axis of the object. I''ve tried using glPush and PullMatrix but this makes the problem worse. Any ideas.
It sounds like you have your order of operations mixed up. You have to perform the local rotation operation before you do the translation. I don''t think that you can concatinate the rotation/translation. Also make sure that your center of rotation is the center of the poly and not some point outside or it won''t work either.



Creativity -- Concept -- Code

Your game is nothing if you don't have all three.

Creativity -- Concept -- CodeYour game is nothing if you don't have all three.http://www.wam.umd.edu/~dlg/terc.htm
Advertisement
glPushMatrix();
glTranslatef(obj.x,obj.y,obj.z); // placement of object
glRotate3f(angle,0,1,0);
draw object
glPopMatrix();

This topic is closed to new replies.

Advertisement