I'm drawing some entities with data that I get from a service.
However, the height values that I get always put the entities under the terrain. Is it possible to detect this and move them to the top of the terrain?
Thanks in advance.
I'm drawing some entities with data that I get from a service.
However, the height values that I get always put the entities under the terrain. Is it possible to detect this and move them to the top of the terrain?
Thanks in advance.
Most entity types should have a heightReference
property that’ll allow you to clamp it to the ground (see https://cesiumjs.org/Cesium/Build/Documentation/HeightReference.html#.CLAMP_TO_GROUND )
For example, when creating a point (https://cesiumjs.org/Cesium/Build/Documentation/PointGraphics.html) you can set the heightReference to Cesium.HeightReference.CLAMP_TO_GROUND
and that’ll ensure it’s always above ground on the terrain. Here’s a Sandcastle example: