Rotate mesh around z axis to align to cesium terrain

I generated a geolocated mesh from a heightmap. The position in the world is correct, the mesh overlays the existing cesium terrain tile.

How can i adjust the z rotation of my mesh to align to the cesium terrain? Currently the rotation of 0 in unreal engine coordinates is about 2.6 degrees off. I use WGS84 for cesium.

I attached an image to showcase the wrong rotation of my mesh.

Hi @Nils_van_Luck, welcome to the community!
I may be misunderstanding the question, but if you want to rotate a Cesium3DTileset, just change the usual Unreal Rotation property on that Actor.

When working with Cesium terrain streamed via a tileset.json, slight rotational misalignment (such as a few degrees offset in the Z-axis) is typically caused by differences between Unreal’s local coordinate system and Cesium’s geospatial reference frames (WGS84 / ECEF).

A practical approach to resolving this is to derive the correct orientation from geospatial data rather than manually adjusting rotation. Specifically, you can extract the center latitude, longitude, and altitude of the misaligned mesh region and convert these into Earth-Centered, Earth-Fixed (ECEF) coordinates. From there, you can compute the local East-North-Up (ENU) frame, which defines the correct orientation relative to the Earth’s surface.

Using a Python script (or equivalent tooling), you can calculate the rotation offset between your mesh’s current orientation and the expected ENU frame at that location. Applying this corrected rotation (particularly around the Z-axis in Unreal) will align the mesh accurately with the Cesium terrain.

This method ensures consistency and avoids trial-and-error adjustments, making it especially useful for workflows involving georeferenced heightmaps or procedurally generated terrain assets.