-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flyto options #5070
Flyto options #5070
Conversation
flyOverLon - longitude which we want camerra to cross duiring the flight flyOverLonweight - Fly over the lon specifyed via flyOverLon only if that way is not longer than short way times flyOverLonWeight.
This flyto option allows to point camera down duiring the flight if camera flyes higher than pitchAdjusAltitude That helps to keep Earth in sight duiring the long flights.
Cool, thanks for this, @kiselev-dv! @bagnell can you please review this once you wrap up #5021? @kiselev-dv a few quick comments:
For more general info on contributing, see the Pull Request Guidelines. |
@pjcozzi what would be better to use for Now I'm using radians because angular properties in Cesium is used to be in radians, but I always forget that it's in radians, so I'm afraid others will be confused as well. So what will be more Cesiumish?
|
Use the last option:
Everything in Cesium is radians; see the Units Section of the Coding Guide. |
* Tests for fly over longitude
|
Great, thanks so much @kiselev-dv! @bagnell please review when you're available. |
@kiselev-dv I made some minor code style tweaks in 29f351b. This looks great! Thanks! |
Also, can you add yourself to CONTRIBUTORS.md if you aren't already listed. |
Sorry for separate PR just for Contributors. |
Add new options to `Camera.flyTo`: CesiumGS/cesium#5070
Forum discussion http://cesiumjs.org/forum.html#!topic/cesium-dev/naHiF2_0F5M/discussion
I've added 2 new mechanics to camera flyto.
First one is pitchAdjusAltitude
When you fly for a big distance and with high altitude and start pitch and end pitch are quite close to zero, Earth goes out of sight.
That happens because pitch interpolated linear between start and end points, and with high altitude camera looks straight and Earth goes out of viewport.
What I want, is to point camera down during the high altitude flights.
So camera pitch interpolates following way:
(startPitch) ----- ( straight down ) ----- (endPitch)
Pitch interpolated accordingly to camera altitude distance between start/end altitude and middle point.
But for small altitude I wan to leave default behavior. I've implemented flyTo options parameter pitchAdjusAltitude. If camera goes higher than this altitude, camera pitch interpolated as mentioned above.
If this option is omitted, or camera goes lower, pitch interpolated as it was.
Second item is flyOverLon and flyOverLonWeight options.
Lets say you want to fly camera from Los Angeles to Tokyo. There are two ways on globe to do that:
a) over Pacific ocean (shortest path which is used now)
b) over Atlantic and Europe - which some times may be preferable, because it's populated and the rest of your data might be located there.
So to be able to specify which way you want camera to fly, you can add flyOverLon. For example above you can set it to 0 (Greenwich meridian).
flyOverLonWeight sets treshold for this option, camera will fly over flyOverLon only if this way is shorten than default way * flyOverLonWeight. In a nut shell we'll fly over flyOverLon until it's not too far away.