CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.76k stars 3.46k forks source link

Limiting Camera Tilting #9689

Open srothst1 opened 3 years ago

srothst1 commented 3 years ago

This issue stems from the following community forum post: https://community.cesium.com/t/how-to-limit-tilt/14459

There has been a significant history of community forum questions/complaints related to camera functionality in CesiumJS. Limiting the camera tilt can help prevent users from ending up "underground" or getting lost in the scene by moving the mouse rapidly to tilt the camera to view both extremes (+90 degrees, -90 degrees). Adding an additional function called limitTilt() to the Camera object may make sense, although other suggestions are welcome.

In offline discussion, both @lilleyse and @ebogo1 seem to support this feature as well. Here is a sandcastle demo that showcases how this feature might perform:

https://sandcastle.cesium.com/#c=lZRfb9sgFMW/CvKTI3l4Ux/rRJPSvlVb1Sp78guBmwQVA+KPq27qdx829upgb8keIsWXc373cgxuiUEth1cwaI0kvKItWO4b/KOv5XVG++etko5wCabOVre1bIPrKNQegim6saUgAffFQUBJA4akilgNkiiy1BBHT9+UaYg4H2FLjAv/iLzJx57aQMuVt4/KcseVvNpwxw3Q/3Ls9NXSJ348uX+qg36agVbW7TQjDjBh7L4F6R64dWHJ5Acv+0HzFfpVS4S6RnJMp48XgxBcW8UZPoJi4Dh99uZAKMQU886Ghvi7Xn1URaye5d2V4nixD1Pu0Sjmabeb2U5wWM4HKhvzLIbhOgxC3Y8fUD4Bbdbo02d8M+xmNtZiIyqUhDx92UXqjT3/INnkHV9i3n3Mn7oTqtdX4Ha6+NAnADOcjkuM/hQVZ65IekcgLIz5LVyBv5HTEzDzjpMu3ZIL0MkBmLlT7E5f5nldTPQp4elChtPQinPXkGEt31e3WZFV1r0J2EQ8Ql95o5VxyBuRY1w6aLQI19KWe09fwGFq7ThLVU6tFeMt4my98IFEVBBrw8rBC/HMf0Kdbaoy6GdWoQjj8vi9BSPIWyc7fdk8xCLGuCrD47LTKSX2xCTk3w

While this demo is not perfect, it should give readers an idea of what we are looking for.

lilleyse commented 3 years ago

This would be a really welcome feature.

My thinking is that it would a property called minimumTiltAngle in ScreenSpaceCameraController. The implementation would be almost completely be in ScreenSpaceCameraController instead of Camera.

robmilton commented 3 years ago

I agree this would be a really welcomed feature. I'm not sure what the various additional use cases may be. But I’d like to emphasize the REASON I’m wanting to limit the tilt (and the reason expressed by many forum posts over quite a few years) is to avoid the problems that can be experienced when tilting the scene. These problems include apparently ending up underground or getting entirely lost in the scene (completely turned around, in black space, don’t know where you are). It’s even possible to sometimes get into a state that Cesium can’t recover from.

More details related to this issue and some videos showing various problems that occur when tilting the scene using the Hello World Sandcastle demo can be found at the community forum post: https://community.cesium.com/t/how-to-limit-tilt/14459

robmilton commented 3 years ago

Hey guys... any idea if this feature will find its way to production in the near future?

ebogo1 commented 3 years ago

@robmilton At this time it doesn't seem like we'll be able to get to this in the near future, but we have this and other Camera fixes in mind for when we get a chance to work on them.

ebogo1 commented 3 years ago

This PR might fix this if merged - https://github.com/CesiumGS/cesium/pull/9147

robmilton commented 2 years ago

Hey guys, there have been multiple requests and pull requests over the past couple of years related to limiting the tilt (particularly to avoid scene crashes). Is there any chance this will be addressed before long?

ggetz commented 2 years ago

Hi @robmilton, no immediate updates. As @ebogo1 said, we do think the Camera API needs some attention, but currently don't have any immediate plans for the team to work on this.

If you are interested in contributing a fix, we'd be happy to discuss the approach ahead of a pull request so that we're on the same page about the implementation.

BrunildaArup commented 1 year ago

has anybody found a way around this?