第一人称视角漫游
官网教程:https://sandcastle.cesium.com/?src=Camera.html
参考:https://blog.csdn.net/xietao20/article/details/109403005(Cesium第一人称漫游)
public losAngelesToDestination(adjustPitch: boolean) {
const camera = this.scene.camera;
const destinationOptions = {
destination: Cartesian3.fromDegrees(121.506377, 31.245105, 3000.0),
orientation: {
heading: Math.toRadians(-15.0),
pitch: -Math.PI_OVER_FOUR,
roll: 0.0
},
duration: 20,
// flyOverLongitude: Math.toRadians(30.0),
pitchAdjustHeight: 0
};
const laOptions = {
destination: Cartesian3.fromDegrees(120.2723, 30.3362, 10000.0),
duration: 5,
orientation: {
heading: Math.toRadians(-15.0),
pitch: -Math.PI_OVER_FOUR,
roll: 0.0
},
pitchAdjustHeight: 0,
complete: function () {
callback();
}
};
laOptions.complete = function () {
setTimeout(function () {
camera.flyTo(destinationOptions);
}, 1000);
};
if (adjustPitch) {
tokyoOptions.pitchAdjustHeight = 1000;
laOptions.pitchAdjustHeight = 1000;
}
camera.flyTo(laOptions);
}
网友评论