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

Thread: Getting overhead rotation angle from matrix?

  1. #1
    Intern Newbie
    Join Date
    Nov 2010
    Posts
    40

    Getting overhead rotation angle from matrix?

    Hello,

    I have what I believe to be a typical OpenGL camera setup. I need to figure out the rotation angle of the camera around the Y axis. I have been doing this by getting the Euler angles from my camera rotation matrix (in YXZ order) and then using that Y as the value. It seems to work when the camera is low to the ground, but the more vertical the camera becomes, the angle seems off.

    Basically I guess I could also do this by getting the XYZ camera position and projecting the vector from the origin to there onto the flat ZY plane. That would basically give me the angle, as if the ground plane were a clock face and that vector one of the hands.

    Is that the best and/or easiest way to do it? How would I actually do that?

    Thanks!
    Bob

  2. #2
    Intern Newbie
    Join Date
    Nov 2010
    Posts
    40
    nobody knows?

  3. #3
    Intern Newbie
    Join Date
    Nov 2010
    Posts
    40
    Still want to know how to do this! Anyone?

  4. #4
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    491
    Project the points (0,0,0) and (0,0,-1) by the inverse of the model-view matrix, and subtract the results.

Posting Permissions

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