How to reduce wild swing in Cesium camera.flyTo?

المشرف العام

Administrator
طاقم الإدارة
Cesium's camera flyTo produces a pretty wild swing. Try it out by going here:

http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Cesium Widget.html&label=Showcases

and paste in this code:

var viewer = new Cesium.Viewer('cesiumContainer');//Cartesian3.fromDegrees(longitude, latitude, height, ellipsoid, result)//new york 40.7127° N, 74.0059° Wviewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(-74, 41, 500000), duration: 0.5 });setTimeout(function() { //Tokyo 35 N, 139 E viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(139, 35, 500000) });}, 4000);We start out looking at New York. We are trying to fly to Tokyo. In the middle though we swing way out to look into space. I feel like the camera should stay pointing to the center of the earth throughout. Instead it seems like it swings really quickly to look to the direction it will end up looking, then flies to the right place in space to look at the point it was set to fly to. This seems to happen any time you fly from places that are far enough apart to require a significant camera angle change.

Is there a way to keep it looking at the center of earth throughout, and to not fly quite so far into space?



أكثر...
 
أعلى