MSL as base reference for terrain in CesiumJS

Hi everyone, I am currently trying to build a viewer for 3D tiled models with CesiumJS.

I’m facing the problem that my model keeps disappearing under the Cesium world terrain.
This happens because my model is referenced to mean sea level (MSL) and the Cesium world terrain is referenced to WGS84 ellipsoid.

So, my question is if there is any way to “re-reference” the terrain to MSL?

Thank you for your advice in advance!

Hi there,

Do you have any info on how the model was converted into a 3D Tileset originally?

CesiumJS uses height above the WGS84 ellipsoid as opposed to MSL.

Thank you for your reply, Gabby!

Yes, I do have more information about the creation of the model and 3D Tileset.

All steps are being completed in Agisoft Metashape Pro 1.8.

The model was generated from images taken by a drone. The images have a GPS altitude reference.

The 3D Tileset was then created from the model. During the tiling, Metashape converters the GPS altitude to WGS84.

I have extended my research in changing the globe in CesiumJS to MSL but from what I have read online, it is impossible or has not been done before.
That is why I shifted my focus to elevating the tileset.json to the Cesium World Terrain. But I have the same problem that I mentioned in my starting post.

Every time I load the tileset with

const tileset = Cesium.Cesium3DTileset.fromUrl("https://my.url/folder/to/tileset.json").then(async (tileset) => { // Add tileset viewer.scene.primitives.add(tileset); // zoom to tileset viewer.zoomTo(tileset); });

I can watch the model being shoved under the terrain step by step.

As a result, I get something like this:

I’ve tried hardcoding the altitude in the tileset.json but I suspect that the other tileset.json in subfolders are overwriting the altitude of the main tileset.json.

I also tried it with
tileset.modelMatrix = Cesium.Cartesian3.fromDegrees(boundingSphereCenterLongitude, boundingSphereCenterLatitude, boundingSphereCenterHeight + 50);.
When using this, my altitude is now increased, but 6.3 million meters are not very close to the correct height of ~500 meter.
image (2)

The main problem is that I cannot hardcode the altitude of the 3D Tileset because the height and altitude of the Tilesets is different every time. I need a way to stick the bottom of the Tileset to the terrain everywhere around the world.

I would appreciate your help very much!