Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL game programming->PlaneView

This topic is 6151 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

I just bought the book yesterday and I have a question about the example code on page 120. It's a function for placing a "cockpit" in the world. What I find strange about this function is that it does the rotations in the order roll-yaw-pitch. Would that really work? Shouldn't it be yaw-pitch-roll? Here is the code:
void PlaneView(GLfloat planeX, GLfloat planeY, GLfloat planeZ,
               GLfloat roll, GLfloat pitch, GLfloat yaw)
   glRotatef(roll,  0.0f, 0.0f, 1.0f);
   glRotatef(yaw,   0.0f, 1.0f, 0.0f);
   glRotatef(pitch, 1.0f, 0.0f, 0.0f);

   glTranslatef(-planeX, -planeY, -planeZ);
Edited by - lowlevel on November 15, 2001 7:15:12 AM Edited by - lowlevel on November 15, 2001 7:15:56 AM

Share this post

Link to post
Share on other sites
This looks fine to me.

If this is your coordinate system...

| /
/ |

Then the yaw, pitch and roll are accurate. If you are complaining about their order, well that doesnt really matter. You can do those rotations in any order since they are each on different axis.



Share this post

Link to post
Share on other sites
Well that ascii drawing sucked. So much for beginnign spaces.
Let me draw it again.


Share this post

Link to post
Share on other sites

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