Object and World rotations

Started by
0 comments, last by stroma 19 years, 2 months ago
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
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.
+-+-+-+-+-STR

This topic is closed to new replies.

Advertisement