I may find a relatively simple way to solve this issue, by using CallbackProperty. But I’m not sure if there will be other problems. It is still good to use it. It is recommended that you take a look, if possible, and hope to help others who encounter similar problems.
var viewer = new Cesium.Viewer(“cesiumContainer”, {
infoBox: false,
selectionIndicator: false,
shadows: true,
shouldAnimate: true
});
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(105, 30, 15000000)
});
var position = new Cesium.SampledPositionProperty();
position.forwardExtrapolationType =
Cesium.ExtrapolationType.HOLD;
var lastOri = undefined;
var orientation = new Cesium.VelocityOrientationProperty(
position
);
var lastAxis = undefined;
var alignedAxis = new Cesium.VelocityVectorProperty(position);
viewer.entities.removeAll();
var entity = viewer.entities.add({
name: "../../SampleData/models/CesiumAir/Cesium_Air.glb",
position: position,
orientation: new Cesium.CallbackProperty(function(time, result) {
var ori = orientation.getValue(time)
if (ori) {
lastOri = ori
} else {
return lastOri
}
return ori
}, false),
model: {
uri: "../../SampleData/models/CesiumAir/Cesium_Air.glb",
minimumPixelSize: 128,
maximumScale: 20000
},
billboard: {
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABQklEQVR42u1VOwrCQBSMYOEF7EQE7yBW1t5BEKxt0ljbaOMRxMIbWFp6AiutRQ1opeAB9DkPXjDoJuazu4JkYEh2eTszbLJvHScFiIhZBvdCfnesAoYbemFr05jZpE80re0CjGaKADObu3BQBDjYDKBEHiAP8N8BfH08axSOWrBWtzH3+wV9B9eUtQWBSAmcUnLwmlJW8zFlxziNsQveSR9Yy43znTvgjcyBtTsf/wcGLfCYQOgRcy4M7NX6eq4FHrgEJ2AXrEfU1qVmImu8KOH3AGtwDg7ANliJ+FShgqqjx1qiORCPNQXECr/qhGm888vID3BR+F9tBlgpAqxsmfOldFIEOPuXkEnzRowm0zBl3kvQ6Xqm//zdW+s+ypy5EyEXyRCsyrgf8OvLXFVqbrrNC4q5YiBAUVuXSxhsxMyi8QTgFyrjcMz6hwAAAABJRU5ErkJggg==',
alignedAxis: new Cesium.CallbackProperty(function(time, result) {
var axis = alignedAxis.getValue(time)
if (axis) {
lastAxis = axis
} else {
return lastAxis
}
return axis
}, false),
pixelOffset: new Cesium.Cartesian2(100, 100)
}
});
var positions = [
{
lng: 132.399,
lat: 51.478
},
{
lng: 136.607,
lat: 49.992
},
{
lng: 136.69,
lat: 47.022
},
{
lng: 135.287,
lat: 43.969
},
{
lng: 134.621,
lat: 42.52
},
{
lng: 132.317,
lat: 41.906
},
{
lng: 130.666,
lat: 39.844
},
{
lng: 129.056,
lat: 37.831
}
];
var i = 0;
setInterval(function() {
position.addSample(
Cesium.JulianDate.addSeconds(
Cesium.JulianDate.now(),
1,
new Cesium.JulianDate()
),
Cesium.Cartesian3.fromDegrees(positions[i].lng, positions[i].lat, 20000)
);
i++;
if (i > 7) {
i = 0;
}
}, 2000);
Sancastle: Link