Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Roll Pitch and Yaw - Airplane style rotation

  1. #1
    Newbie Newbie
    Join Date
    May 2014
    Posts
    1

    Roll Pitch and Yaw - Airplane style rotation

    Hello,

    I have searched a lot for this problem online, but I am yet to find a solution to it.

    How can I implement airplane style rotations in OpenGL (roll, pitch, and yaw),

    Right now, I am using glRotatef as:

    glRotatef(roty, 0, 1, 0);
    glRotatef(rotx, 1, 0, 0);

    However, after rotating along y (roll), x-rotation is NOT a pitch from the plane's perspective (local axes?). Rather, it's a rotation around x, which is as expected.

    I am wondering how to achieve the airplane style rotations.. any pointers will be appreciated.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,124
    Conceptual order: HPR (Heading, then pitch, then roll). Heading (being a rotation around an "up"-axis), pitch (being a rotation around a "right"-axis), and roll (being a rotation about a "forward"-axis). As usual, when thinking about position an object within a coordinate frame vs. transforming between coordinate frames, you need to flip the transform order.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •