Orientating Model in ECI

Hey everyone,

After a lot of head scratching it looks like we were able to correctly orient our model in ECI.

For some reason it looks like when a quaternion input is provided to the entity.orientation property the model is orientated in ECF. This can be seen through this Cesium Sandbox. Scrubbing through the timeline you can see the model do the same rotations the Earth is conducting even though the positions value provided in the CZML is in INERTIAL reference frame. Unsure if this is as desired.

In order to orient the model in ECI you must do the following:

// Incoming quaternion data
const quaternionInput = new Cesium.Quaternion(0, 0, 0, 1)

// ECF to ECI conversion
const orientationECF = new Cesium.Quaternion()
const ECFToECI = Cesium.Transforms.computeFixedToIcrfMatrix(viewer.clock.currentTime)
const ECFtoECIQuaternion = Cesium.Quaternion.fromRotationMatrix(ECFToECI)
const orientationECI = new Cesium.Quaternion()
Cesium.Quaternion.multiply(orientationECF, ECFtoECIQuaternion, orientationECI)
Cesium.Quaternion.conjugate(orientationECI, orientationECI)
entity.orientation = orientationECI

We used various checks to verify that we are indeed in ECI no matter our positioning and pass all. I suggest you carry your own checks and verify that your model is indeed orientating in ECI. Hope this helps anyone else!

Thanks,
Brian