The height of the sea is not 0

Hi @leielyq,

Cesium for Unreal does not provide a way to set the sea height to 0, nor does it have a way to “pretend the world is flat” and ignore Earth curvature. But it should be possible to put your objects on the water surface without too much trouble.

If your area of interest is relatively small, such that Earth curvature is negligible, you can probably get pretty close to “sea is at Z=0” with just a little bit of effort. The main trick is in figuring out the WGS84 height of mean sea level (MSL) at your location of interest.

First, figure out the latitude/longitude at the center of your area of interest. Then, enter that lat/lon into an online EGM96 calculator, like this one:
https://geographiclib.sourceforge.io/cgi-bin/GeoidEval

This will give you an EGM96 geoid height. Back in Cesium for Unreal, select the CesiumGeoreference, enter your latitude and longitude into the Origin Latitude and Origin Longitude fields, and copy the “EGM96” geoid height in the Origin Height field. Having done this, Unreal Z=0 will be located exactly at EGM96 Mean Sea Level at that point. In most (but not all!) parts of the world, the Cesium World Terrain ocean surface will be at this height as well.

Alternatively you can do this graphically. Put a cube or some other object at (0,0,0), and then adjust the Origin Height value of the Cesium Georeference until the ocean surface goes through the cube’s origin. This will work even if the CWT ocean geometry isn’t located at exactly EGM96 height 0.0 in your area of interest.

Of course, as you move away from that origin, the planet will “drop away” due to Earth curvature from that Z=0 plane. Hopefully it won’t be noticeable before you’re outside your area of interest.

If you need a larger area, and Earth curvature becomes a problem, the next step is to dynamically calculate the mean sea level height at that location using the EGM96 model. That’s quite a bit more work, though, so hopefully you don’t need to go there.

Kevin

1 Like