Calculate Compass North angle in cesium environment

I was looking for a specific function in cesium that gave the north angle on DynamicPawn current location and rotation. There is a node ComputeEastSouthUpToUnrealTransform but the values are not looking as expected. Is there a way we can implement a Compass functionality using Cesium libraries?

You can use the north pole’s actual position (i.e. Latitude 90°, Longitude 0°) and get its “Look at Rotation” towards an actor.

This is how I have implemented a compass mesh to always point in North direction.
The “minus 90” node is due to my mesh’s innate forward direction so you might not need that.

@arbertrary Thanks for the solution. It works for world rotation but can we get an angle between -180 to 180 degrees to rotate an image in the user widget?
As for now, it gave values in decimal

You will probably have to do some vector calculations separately to achieve that.

Here’s for example some blueprint code that I am using to calculate the azimuth for a Strike & Dip measurement tool (Tilted Beds and Strike and Dip – Physical Geology Laboratory)

The rough idea is this. Maybe you can use something of it for your use case.

1 Like