//相机绕点飞行
addCameraFly(){
const center = Cesium.Cartesian3.fromDegrees(118.08392927033496,36.9440487626934);
let heading = Cesium.Math.toRadians(50.0);
const pitch = Cesium.Math.toRadians(-20.0);
const range = 3000.0;
let x=50;
var self=this;
viewer_g.scene.postRender.addEventListener(function () {
x+=0.1;
heading = Cesium.Math.toRadians(x);
viewer_g.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range))
}
});
},
切换其他场景时,如果又要用到camera.flyTo相机会跳到很高的视角然后在定位,而不是平滑的进入,解决方案