Open hpinkos opened 7 years ago
I've seen other globes (at least WorldWind I think) handle this using a separate class, we could call ours CameraLimiter
or something similar. This class would allow you to set min/max values for anything that makes sense on the Camera. Then every frame, it's job is to check for out of bounds values and set them to the min/max if they are outside the desired configuration. This should provide a flexible and elegant solution and allow us to set limits on all kinds of things (boundary, rotation, direction, etc..)
Also reported here: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/x8-uWKKlYNc
@rahwang this could be a good one for you for next month if you are interested.
Yes please! I'll add this to my list
This will be helpful for something I'm working on too =)
Yep, I would love to see this because we'll have good use for it on cesium.com, has been on my todo list forever. I've has discussions with bagnell in the past on how best to implement this, so let me know if you want to talk before tackling it.
CC #3111
Sketchfab just added a similar feature: https://blog.sketchfab.com/introducing-camera-constraints/
I would appreciate this as well! Even a simple boolean option such as "clampCameraToEdges" for the 2D map would be great. It seems of marginal utility to let people scroll past the north & south poles, as you currently can.
Someone requested this at the FOSS4G cesium workshop as well. I think this would be a really popular feature if anyone has the chance to look at it soon.
It's also a nice onramping issue. @ggetz please add this to your backlog.
Any updates on when this feature will make it into a release?
@scottnc27603 no update, but contributions are very welcome if you have the bandwidth.
Initial work by @hanbollar in this branch: https://github.com/AnalyticalGraphicsInc/cesium/tree/camera-limiter
See #6381 and #6172
Requested on the forum again: https://groups.google.com/forum/#!topic/cesium-dev/NzcIdGyfSt4
@OmarShehata also had some thoughts in https://github.com/AnalyticalGraphicsInc/cesium/issues/8143#issue-491026306
where can i get the imp code?
Requested in the forum: https://community.cesium.com/t/is-there-any-way-to-constrain-extent/26745/7
Requested on the forum: https://community.cesium.com/t/limit-user-camera-movement/22992/3
Hello,
is there any update on this feature?
I was able to limit (and it works pretty well!) the camera min/max elevation using the: Cesium.ScreenSpaceCameraController.minimumZoomDistance
/Cesium.ScreenSpaceCameraController.maximumZoomDistance
but i can't find anything in terms of bounding box where the camera should stay
Hello, is there any update on this feature? I was able to limit (and it works pretty well!) the camera min/max elevation using the:
Cesium.ScreenSpaceCameraController.minimumZoomDistance
/Cesium.ScreenSpaceCameraController.maximumZoomDistance
but i can't find anything in terms of bounding box where the camera should stay
Would also be interested to hear if there are any plans to implement this feature.
I have a working cesium class that allow to limit camera movement by bbox + zmax, or by entity + distance in meter. Contact me if you are interested.
I have a working cesium class that allow to limit camera movement by bbox + zmax, or by entity + distance in meter. Contact me if you are interested.
Hi @romain974 - could you please guide on how to limit camera movement? Thanks, Matt
Hi @romain974 - could you please guide on how to limit camera movement? Thanks, Matt
Requested on the forum https://community.cesium.com/t/limit-camera-to-a-zone-volume/34347
Hi @romain974 - could you please guide on how to limit camera movement? Thanks, Matt Hi @jjspace - could you please guide on this and help @adcomere on #34347 Hi @pjcozzi - could you please help get this function in real soon so that so many local community virtual twins can be implemented and kept with the local focus that's important to them? - thanks, Matt
One way to do this by yourself is to use scene postrender event to test camera distance // limit and allow or stop camera move. You also need to store each previous camera value to be able to restore it when camera reach limits. If you wan't a full working code, contact me to purchase the module.
I'm also adding more noise here to express our desire of this feature.
Thank you.
I need some time to generate a public, open source code. => JS Class with functions to limit camera by bounding box or distance // cartesian3 + signal when camera hits limits
If you want to contribute to this project: https://github.com/sponsors/romain974?frequency=one-time
Target => mid october
I've seen this requested on the forum a handful of times, most recently here: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/z-kWiAZ1Jfg
For some applications, it would be helpful to define a rectangle to restrict the camera to view only a certain span of the map.