How to get translation/rotation in degree from ModelMartrix.

Hi,

I want to get the translation and the rotation of the matrix in degree from ModelMatrix or position of the model from entities. I can get the translation and the rotation from the below code.

var position = viewer.entities.values[0].position._value

or

var position = Cesium.Matrix4.getTranslation(globeScene.primitives._primitives[0].modelMatrix, new Cesium.Cartesian3());

``

Help me to convert the “position” in degree.

Thanks in advance!

Hello,

If you have the Cartesian3 position, first you need to convert it to a Cartographic. This can be done with:

var cartographicPosition = viewer.scene.globe.ellipsoid.cartesianToCartographic(position);

Cartographic has the longitude and latitude values in radians. You can get the degree values with:

var longitude = Cesium.Math.toDegrees(cartographicPosition.longitude);

var latitude = Cesium.Math.toDegrees(cartographicPosition.latitude);

Hope this helps!

-Hannah

I expected this result only.

Thank you so much Hannah!