A marker which then moves along this route (path?)
A camera that follows the marker as it moves
I had to take a short break from cesium development, so I am just getting back into it. I would like to confirm what I am thinking…
I have the lat, lng and heights of the gps trace (from another mapping source) - I will therefore need to first “sample the terrain” to get the correct heights?
I would then follow something like the interpolation demo?
If the gps trace has height data associated with it, you might not need to sample the terrain. It depends on whether the heights are relative to the terrain or relative to sea level.
And yes, the interpolation demo looks like it would be a good place to start for what you’re trying to do.
Yep, that is what I would do. In the callback function for sampleTerrain, you will have an array of cartographic positions with a height equal to the terrain height. You’ll have to add your gps data height to that (something along the lines of terrainSamplePositions[i].height+= gpsData[i].height )
I have implemented this but the path is still not flush to the terrain in some areas, and it goes under in others.
It is a ground level activity, and I have used the sampleTerrain + added a small amount so the path is visible, but its a bit hit and miss if its flush to the surface.
You can try passing a larger number for the level value to the sampleTerrain function. This may take longer to compute, but it should be more accurate. We are planning to support polylines on terrain sometime soon, but for now this method is the best workaround we have.