How to set Rotation(East-Up-North)?

I want to set CesiumGlobeAnchorRotation(East-Up-North), but take a look at the CesiumGlobeAnchor component, I cant found the way to set it

CesiumGlobeAnchor has a rotationEastUpNorth property. Just set it. The property is a Quaternion, so if you want to set it with Euler angles instead, use Quaternion.Euler:



That’s my code, but it doesn’t work. What’s wrong?

The UI displays Euler angles. You’re setting a quaternion. And in fact you’re setting an invalid quaternion. Use that Euler method I mentioned previously. Something like this (untested): _cesiumGlobeAnchor.rotationEastUpNorth = Quaternion.Euler(0, 0, 0);

Cesium rotationEastUpNorth is a Unity.Mathematics.quaternion, not UnityEngine.Quaternion. I just created a function to convert to Unity.Mathematics.quaternion to UnityEngine.Euler (Vector3)

  public Vector3 ConvertToEuler(quaternion qd) //qb = quaternion double
  {
      Quaternion q = new Quaternion((float)qd.value.x, (float)qd.value.y, (float)qd.value.z, (float)qd.value.w);
      return q.eulerAngles;
  }

Not sure how expensive that conversion is but hopefully its not much. Maybe there is an easier more efficient way to do the conversion?