Sign in to follow this  
connell

Object and World rotations

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this