I am using Cesium 1.6 camera.flyTo api for flying to the destination selected by the user. When using flyTo api camera is looking down and then applying the orientation.
Below is the code i used.
camera.flyTo({
destination : globalCesium.Cartesian3.fromDegrees(long, lat, height),
orientation : {
heading : globalCesium.Math.toRadians(parseFloat(headingdegrees)),
pitch : globalCesium.Math.toRadians(0.0), // (looking straight)
roll : 0.0, // default value
}
});
Is there is anyway to avoid/change the default behavior of the camera from looking down for flyTo api?
I already asked the same question (If I understand you correctly). As the result, I’ve made own flyTo animation using linear interpolation of camera Cartographic position and its Up vector between start and end values over time. It was a bit better for me but not very good too.
Seems to me good solution for such camera transfer is not obvious, it needs more complicated algorithms and also experimenting with their parameters. It’s rather labourious.
The majority of the flight should have the camera looking at the destination, even if that means looking through the Earth if it’s beyond the horizon. Perhaps use roll 0 during the flight. Only during the last second or so should it start to turn toward the final orientation.
Flight position
You should be able to declare: flight_time, cruising_altitude, and cruise_ratio. (cruise_ratio 0.8 would mean 80% of the time is spent cruising) Though if you don’t want to bother setting those it could calculate some good defaults for you. Such as setting cruising_altitude based on distance traveled.