Jump to content
  • Advertisement
Sign in to follow this  
lukar

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Ademan555
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


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!