-
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
Adjust camera controls for when the globe is off, and when panning in 3D #11268
Conversation
Thanks for the pull request @ggetz!
Reviewers, don't forget to make sure that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ggetz, this change makes it significantly easier to control the camera!
I'm noticing one issue with panning: If I drag a point in the backround, and a tileset feature crosses my cursor position in the foreground, my cursor is now locked to the foreground feature instead of the point I originally clicked on.
See this screengrab from the Melbourne photogrammetry tileset:
https://user-images.githubusercontent.com/41167620/236309442-f3a4b8b1-aa7f-4177-94c2-b2d0a6068bd5.mp4
Would it be possible for pan3D
to remember the 3D position of the point I originally clicked on?
Thanks @jjhembd! This should now be fixed. Let me know what you think. |
Thanks @ggetz! That last commit does indeed fix the issue with foreground features, when panning from left to right. I did notice one more thing: when panning up and down in an oblique view, the picked point doesn't seem to keep up with the cursor. Here's what it looks like on my machine (from this local Sandcastle): 2023-05-05.camera-controls.mp4For comparison, here is the same up-and-down panning action in v1.105 (on sandcastle.cesium.com): 2023-05-05.main.mp4 |
Could we use the new math only when the globe is off? The new flow is undeniably better when navigating a tileset with no globe defined. But with a globe and no tileset, the old math is more intuitive. Compare the current behavior with no tileset. When dragging, the picked point on the globe mostly stays under the cursor. 2023-05-09.main.mp4With the new math and no tileset (Local Sandcastle), the picked point goes far ahead of the cursor: 2023-05-09.camera-controls.mp4I have to admit I don't understand the |
Fair point @jjhembd. I adjusted so that panning only uses the new behavior when the globe is off. Rotating around a fixed position and zooming will still always use the picked position (whereas before they were using the ellipsoid position), but I think we agree that behavior is a definite improvement. |
Thanks @ggetz! I think this is good to go. Merging now |
Fixes #7171
Picking for all camera controls had some strange conditions:
scene.pickPosition
was never used if the globe was undefined (so the ellipsoid was picked instead), which is not a strict requirement. Now, we always go with thescene.pickPosition
result if defined and the globe isn't, then fallback to the ellipsoid as needed.pickGlobe
function topickPosition
Panning formerly did not pick at all and instead used only the ellipsoid. 3D panning now picks a position based off the initial mouse position and moves in worldspace based on the mouse translation. This allows for much better control when panning through 3D tiles such as a cityscape, or other more vertical surfaces.
I did my best to test a variety of scenarios including combinations of the following, but let me know if there are any blind spots:
globe: false
globe: false