Do not want to see through terrain when rendering underground objects

I have been working on rendering underground assets in Cesium but encountered a problem.
When I rotate the underground object, no matter which angle I use, the underground 3d model always shows even when it’s not supposed to, for example, when looking from the air, it’s supposed to be buried under the terrain.

It’s important that we do not see through the terrain. Otherwise it will be confusing to perceive the underground nature of the object because it will always show despite the viewing angle. It appears that the underground object floats above the terrain when viewing from above.

Anyone has same issue and insights?

Thanks!

Hmm. In order to see underground you must have set the globe / terrain to be transparent at some point?

Cheers,

Alex

I actually do not want to see through the terrain. I did not set the terrain transparent but the underground object is still showing as if it is above ground when looking from above.

Ok, hang on. What sort of “underground object” are we talking about? I know billboards and other entities might do this, as their views aren’t linked to the terrain views. Is that what we’re talking about? How do you create these underground objects in Cesium now?

Cheers,

Alex

I upload dae to Cesium and Cesium convert it into gltf.

Maybe it would be because depth testing was disabled.

But you upload what data? What is it? Ok, so gltf becomes entity geometries, so the key would be to start with;

viewer.scene.globe.depthTestAgainstTerrain = true

Then play around with the docos for Models at Model - Cesium Documentation especially the heightReference. Default is NONE, but you might make it relative to Terrain (which should push it under, but depends on your reference model and transforms).

Cheers,

Alex

1 Like

Or you might set the geographic position of your model incorrectly.

1 Like

Thank you Alexander and Zhefeng. I will look into it more.

1 Like