Quaternion Angle to Euler Angle conversion issue

Hi, I’m trying to convert Quaternion angle to Euler angle by converting x,y,z,w to HeadingPitchRoll but not getting correct Euler value. I’m not sure if HeadingPitchRoll is Euler or not.

Please check this sandcastle .

How can I get correct Euler value?

  • Regards

However, I’m getting correct Euler values but these are in Radians and I need to convert them to Degrees. I’m doing that by multiplying HPR values with 57.2958.

But is there any inbuilt function to convert Radians to Degrees?

  • Regards

hi @Jacky,

you can use Cesium.Math.toDegrees(value) or Cesium.Math.toRadians(value) for conversion.
Basicly it’s just multiplying/dividing your value with 180/Pi.

Be aware that those angles are relative to earth center, not the “local” HPR (orientation of a Model relative to the earth surface).

Best, Lennart

1 Like

Thank you @lennart.imberg for clearing my doubt.

  • Regards