Test code: use the parameter static constant cell.extrapolationtype.hold—it explains When the sample data is out of range, the first or last value will be used. But in fact, we always keep the first value, or the east direction, and we can’t keep the direction of the last frame. After testing, the following code will turn to the east when it stops while i wonder it keeps the direction of the last frame. The following code can be copied directly into the online example of cesium _–Cesium Sandcastle
Please ! thank you very much!
var viewer = new Cesium.Viewer(“cesiumContainer”, {
shouldAnimate: true,
});
let czml = [{
“id”: “document”,
"version": "1.0",
"clock": {
"currentTime": "2020-12-20T16:00:03Z",
"multiplier": 1
}
}, {
"id": "line1",
"name": "XX路线1",
"availability": "2020-12-20T16:00:00Z/2020-12-20T16:05:00Z",
"model": {
"gltf": "../SampleData/models/GroundVehicle/GroundVehicle.glb",
"scale": 1
},
"orientation": {
"velocityReference": "#position"
},
"viewFrom": {
"cartesian": [80, 80, 80]
},
"path": {
"material": {
"solidColor": {
"color": {
"interval": "2020-12-20T16:00:00Z/2020-12-20T16:05:00Z",
"rgba": [255, 0, 0, 255]
}
}
},
"width": [{
"interval": "2020-12-20T16:00:00Z/2020-12-20T16:05:00Z",
"number": 0.0
}]
},
"position": {
"interpolationAlgorithm": "LAGRANGE",
"forwardExtrapolationType": 'HOLD',
"interpolationDegree": 1,
"epoch": "2020-12-20T16:00:00Z",
"cartographicDegrees": [
0.00,108.328947792453,22.7469164044214,0.0,
3.071,108.329388241433,22.7470366141948,0.0,
5.540,108.32928156764,22.7474785429229,0.0,
9.540,108.329014032717,22.7474785429229,0.0
]
}
}]
var dataSourcePromise = new Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSourcePromise);
viewer.zoomTo(dataSourcePromise);