Polyline shows through terrain

I use polyline to show a low altitude air vehicle path history. The trouble is that that the polyline is not masked by the terrain; i.e. it shows through the terrain.

Is there any way to correct this?

Thanks, Matt.

Hiding things below the terrain is not enabled by the default because it can cause issues with data directly on the terrain, but it’s easy to enable with one line.

viewer.scene.globe.depthTestAgainstTerrain = true;

This demo does it: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Interpolation.html&label=Showcases If you comment out line 18 and tilt the view, the line will always be in front of the canyon, but with it enabled it’s properly obscured.

Images attached.

  1. view from above showing the path

  2. level view of aircraft illustrating how path (polyline) shows through the terrain

view_at_aircraft_level.png

Perfect. Thanks.