i have heading, pitch, and roll angle, ccw rotation about positive x-y-z.
this xyz frame is some object’s body frame, not like airplane frame. ‘up side’ is positive z.
if this object had eci to body quaternion, I want to get “eci to heading pitch roll quaternion”.
and I dont know the value of angles’ input.

real data which i have

2. pitch = 45 degree
3. roll = 5 degree
4. eci_to_body_quarternion

//the way I got quaternion down below//

// >> “heading” because i thought down z axis is positive, and ccw rotation about negative z(up side z) in Cesium
const eci_to_hpr_quaternion = Cesium.Quaternion.multiply(hpr_quaternion, eci_to_body_quarternion, new Cesium.Quaternion());

Hi there,

There is a helper function for this: `Transforms.headingPitchRollQuaternion`.

Hope that helps!

i’m sorry for the late thank you.
I’m still fighting this problem. so sad…

1. Transforms.headingPitchRollQuaternion, does “fixed frame” refer ecef?
if it refers to ecef, i don’t think I should multiply the quaternion from ‘eci to body’ quaternion directly by the quaternion obtained from Transforms.headingPitchRollQuaternion.

2. i’m bringing the position of airplane from eci.
can i put the eci position directly into the ‘origin’ of Transforms.headingPitchRollQuaternion?

for example,

const center = positionofairplane; //>>airplane’s position is based on eci