Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. [Euler angles values are incorrect]

[Euler angles values are incorrect]

Scheduled Pinned Locked Moved Unsolved Game Development
1 Posts 1 Posters 340 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    appdev
    wrote on last edited by
    #1

    Hello Guys,

    So I've used class QQuaternion to rotate an object but I also wanted to add a function that returns the euler angles that corresponds to the quaternion.

    However, it seems that euler angles values are incorrect.

    For example: my quaternion is ( w=0.758, x=-0.002 , y=-0.619 , z=0.206), it correpsonds to these euler angles values. x= 47.327, y=-69.927 and z= 64.519 ( verified with quaternion visualization app online).
    however when I run my application, I get these values : x=14.5932, y= -76.0196,z=18.9784.

    Okay, the order in the application with which I verify the rotations is XYZ (there are also ZYX and YZX) but the function that I used in my code, returns euler angles from quaternion in the order ZXY according to Qt documentation

    void QQuaternion::getEulerAngles(float *pitch, float *yaw, float *roll)
    

    It Calculates roll, pitch, and yaw Euler angles (in degrees) that corresponds to this quaternion.
    It means the order is ZXY. Am I right ?

    What shall I do to get the right angle values ? should I convert ZXY rotation returned by that function to other rotations ? or should I look for another application online that converts quaternion to ZXY euler angles to verify that my code works correctly ?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved