1. A concise explanation of the problem you’re experiencing.
I am flying an airplane model through different waypoints. I am sampling the path at regular intervals and creating a SampledPositionProperty at each interval. I would like the Cesium camera to track the plane model, however, since it is time dependent, I don’t know how to “switch” to the new entity when it’s time comes to activate. I know I could add all these positions to just one path, but I don’t want to do that. It is important to retain different paths.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var waypointPath = viewer.entities.add({
availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
start: startTime,
stop: currentTime
})]),
position: waypointSampledPositions,
orientation: new Cesium.VelocityOrientationProperty(waypointSampledPositions),
model: {
uri: ‘…/assets/models/CesiumAir/Cesium_Air.glb’,
minimumPixelSize : 64
},
path : {
resolution : 1,
material : myPathMaterial,
width : 3
}
});
waypointPath.position.setInterpolationOptions({
interpolationDegree : 5,
interpolationAlgorithm : Cesium.LagrangePolynomialApproximation
});
viewer.zoomTo(waypointPath);
viewer.timeline.zoomTo(startTime, currentTime);
flightWaypointPaths.push(waypointPath);
``
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I want to be able to put the camera at the nose of the plane, and get a “Pilot POV” along the flight path.
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.58, Windows 10, Google Chrome/Mozilla Firefox.