Jump to content
  • Advertisement
Sign in to follow this  
connell

Object and World rotations

This topic is 4903 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, Sorry if this is a really common question. Say I have a spaceship. In OpenGL I can rotate that object to any rotation using 3 glRotatef commands. Now, from the perspective of the flyer of the ship, he can alter the pitch, yaw and roll. My question is how can I convert these properties into world rotations which I can perform using glRotatef? I.e. if the flyer of the ship decides to pull up, the pitch of the ship is increased but how do I determine how to alter the rotations performed by OpenGL? Thanks Connell

Share this post


Link to post
Share on other sites
Advertisement
you should use push and pop methods for objects render. it means;
glPushMatrix();
//translate and rotate (glTranslate, glRotate..)
//render the object
glPopMatrix();

with this, you will use matrix stack and you will use world coordinates of object.
hope helps.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!