I cannot have a consistent z=0 level


Newbie question here! I’ll try my best to be as clear as I can.

My final goal is to have a Plane mesh to represent water around a ~60x60km island. In order to do that, it would be very practical to have ocean shorelines at z=0. But it seems impossible to achieve.

Here is my terrain in QGIS. Sub-sea area (z <= 0) is masked with white pixels.

Here is the same view Cesium for Unreal and two terrains:

We can see that DEM0 covering is not correctly masking the sub-sea area. Even if I try my best to manually adjust the z-position of the DEM0 actor:

It is even worst if, after trying to adjust the DEM0 z-position, I move the camera to a close position.


In Cesium for Unreal:

Why DEM0 is not covering eaxctly the sub-sea area?

It happens exactly the same thing if I create a Plane mesh scaled up to 1000000 in x-y directions in Unreal and try to make it cover exactly the sub-sea area.

Also why my Plane mesh should not be positioned at z=0 but I have to set z ~= -8000 to make it (incorrectly) cover sub-sea level? My CesiumGeoreference actor has Origin Height = 0.

Thanks so much!


I’m not sure if I’ve completely followed what you’re trying to do here, but your initial goal doesn’t seem practical to me. Even if you were to perfectly place “sea level” at z=0 in the center of your 60km by 60km island, the same sea level at the edges of the island would end up at about z=-70 meters because of Earth curvature over that 30km distance. I don’t think you can use a plane to represent water over an area that large.


So definitely no Oceanology or anything similar for Cesium :cry:

I imagine you can model the ocean, just not with a plane.

May I ask how did you calculate this z ~= 70m please?

There are a number of online calculators that can work it out for you. This one has a nice diagram showing what is being measured:

Use an eye height of 0. It’s only an approximation, though, as it assumes the Earth is a sphere.

To more accurately model a sea level surface, you’d probably want to use a geoid model like EGM2008.

1 Like

Thank you @Kevin_Ring. I have a dirty hack in mind, let me try that :slight_smile:

Ok, for what it’s worth, I’ve found quick & dirty but actually well working workaround for my use case.

I choosed to simulate a flat map by compensating the heightmap accordingly to the WGS84 ellipsoid reference so that the sea altitude will always be 0 in Unreal coordinates. To achieve this, each point of the heightmap is adjusted by an offset corresponding to the height difference on the ellipsoid relatively to the center of the map.

Of course, the downside is that there will be some ‘walls’ at the edges of the map. The larger the map is, the highest walls will be. This solution is acceptable for a restricted portion of the world, but definitely not for a whole planet.