Hi,
In my game, I need to draw a polyline that is clamped to the ground, I saw that a similar option exists in CesiumJS (Polylined clamped to ground).
Is this option also available in Unity?
If not, how do you suggest implementing it?
Thanks!
Hi,
In my game, I need to draw a polyline that is clamped to the ground, I saw that a similar option exists in CesiumJS (Polylined clamped to ground).
Is this option also available in Unity?
If not, how do you suggest implementing it?
Thanks!
@asaf.masa Thank you for the question! At the moment, I think your best bet is using the Unity LineRenderer component with elevations obtained from SampleHeightMostDetailed. This won’t keep the line on the ground as the elevation changes, but will make sure it’s at the position of the highest detail tile (the terrain that will show when you’re up close), so it’s at least going to look correct from that position.
We’re in the process of adding the functionality in Cesium Native that will enable this to be done more accurately. We’re figuring out a system for placing objects at the height of terrain even as the level of detail changes, and we’re also implementing a Raster Overlay for vector data loaded from GeoJSON that will let polylines (as well as polygons) be rendered over the top of terrain. Unfortunately I don’t have a timeline for these features making their way into Cesium for Unity.