Clamp to 3D tiles for SampledPositionProperty

I been trying to clamp a series of SampledPositionProperty to the 3d tiles. Such as here:

Clam Model to Ground

which is using Cesium.HeightReference.CLAMP_TO_3D_TILE

I made an example that is using the flight path from the tutorial, a circle entity and been trying to clamp it to 3d tile as in the above sandcastle, but not luck.

My Sandcastle

Is it possible to always clamp to the 3d tile ignoring the given height? I tried using 0 as height, not supplying height.


I created a simpler example to describe my use case more concisely.

I have a list of longitude, latitude tuples, but no altitude. An entity on those coordinates is rendered via a method in which I call clampToHeight to get the altitude and add the coordinate via positionProperty.addSample. This method is called in a requestAnimationFrame rendering tick.

It works pretty well, but it can be yanky, also it has issues orienting the entity. So I thought about using the cesium viewer clock and set location samples with their future times and let cesium viewer handle it. But since I don’t have the height at all the points I thought the height reference with CLAMP_TO_3D_TILE would do the trick.

This sandcastle indicated that to me:

So I took the coordinates from that example but adjusted the z of the first to see if it would clamp to the tile. It doesn’t :frowning: Is that possible?, my use coordinate use case has be common. What does CLAMP_TO_3D_TILE do?

Here is my simplified example as described above.

Clamp to 3D Tile Sandcastle

Appreciate any help,