Search code examples
directxquaternionseuler-angles

How to adjust euler angle by quaternion


I am looking for a way of returning an euler angle that has been rotated by a quaternion.

I understand that extracting pitch roll and yaw from a quaternion is problematic at best, but if I could then I would simply add its values to my own in order to get the resulting euler angle.

I could also convert my euler angle to a quaternion and then combine the two but then I would be left with a quaternion that I cant convert into an euler.

I admit I struggle with quaternions at the best of times so any help will be well received.

For clarity I only need to return an euler angle, all other calculations can be done with quaternions if required.

I am using Bullet Physics, Direct X, C++

Thanks.


Solution

    1. You can't combine Euler angles with Euler angles or Euler angles with quaternion directly.

    2. You should convert the rotation into representation allowing transformation composition. It is rotation matrix or quaternion.

    3. After combine of rotations convert back into Euler angles.

    P.S. Euler angles is not useful representation of rotation at all. It only can be used for manual input of rotations.