# Angular Traslation (Rigid bodies) and Rotatef

This topic is 5464 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, i want to rotate an object after some physics calculations... im calculating the angular velocity and the angular traslation of my object but i need to translate that into rotatef parameters and i need a little help with interpretating what they are... Up to now and thanks to the moderators here who have been so kind in closing my previous post i have been able to know that rotatef( angle, x, y , z) well i think MSDN doesnt explain what x y z and angle can be used like... I have the rotation magnitude calculated in radians for my object in x y and z... Do i have to do some calculations in order to calculate a vector that goes from the center of mass of my object to the new rotation position? or how can i interpretate this? angular velocity = (torque / Inertia tensor) * t theta += angular velocity * t where theta is the vector im talking about... So i just need a little help in translating this into rotatef. I have seen dumber questions here so please moderators... be so kind to let me get an answer and continue with my life outside this forums. thank you very much and No im not being sarcastic [Edited by - lukar on October 4, 2004 10:56:30 PM]

##### Share on other sites
Rotatef is basically for euler angles... i personally dont like the setup but hey...

glRotatef(theta,1, 0, 0); //rotates theta along the x axis
glRotatef(theta, 0, 1, 0); //rotates theta along the y axis
glRotatef(theta, 0, 0, 1); //rotates theta along the z axis

hope that helps
-Dan

##### Share on other sites
one thing to remember is that GL is state based, so
a transform affects any subsequent transform calls
eg.
glRotatef(90, 1, 0, 0);
now, the entire "co-ordinate system" has been rotated +90 about the x-axis, this means what was previously the y-axis, is now the z-axis etc.
what i recommned (and prefer) is to create my own transform matrix and then do only 1 glMultMatrix() call

-Danu

##### Share on other sites
Quote:
 Original post by Ademan555Rotatef is basically for euler angles... i personally dont like the setup but hey...glRotatef(theta,1, 0, 0); //rotates theta along the x axisglRotatef(theta, 0, 1, 0); //rotates theta along the y axisglRotatef(theta, 0, 0, 1); //rotates theta along the z axishope that helps-Dan

Which works great for 3D where a rotation is given by a 3 component vector containing euler angles.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 22
• 17
• 13
• 14