Skip to content
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

Google Maps Tiles demo needed improvements #331

Closed
gkjohnson opened this issue May 23, 2023 · 6 comments
Closed

Google Maps Tiles demo needed improvements #331

gkjohnson opened this issue May 23, 2023 · 6 comments
Labels
help wanted Extra attention is needed
Milestone

Comments

@gkjohnson
Copy link
Contributor

gkjohnson commented May 23, 2023

Here's a list of features needed to improve

Improved Globe Orbit Controls

  • Use three.js' MapControls which pans along the camera's "up" direction rather than in screen space. Demo update #346
  • Use the "Ellipsoid" class to derive latitude, longitude, and surface normal from the camera position position so we can adjust the plane the map controls pans on based on the position. Foreground child tiles are empty for a period #46
  • Fix the controls target to be the WGS84 ellipsoid surface so we scroll on a reasonable plane. Demo update #346
  • Use raycasting to adjust the camera / controls target height based on loaded geometry / mountains. Demo update #346
  • When zooming out transition to an orbital camera

Zoom Controls

  • Adjust MapControls to zoom in to the cursor position.

Camera View Range

  • Scale the camera near and far so only necessary tiles are loaded - and tiles on the opposite side of the globe are not. Demo update #346
    • Perhaps keeping the camera far fixed at the perpendicular plane at the earth's center is good enough?

Metadata

Jump to location

  • Use window hash to specify which latitude and longitude to jump to
@gkjohnson gkjohnson added the help wanted Extra attention is needed label May 23, 2023
@gkjohnson gkjohnson added this to the v0.3.19 milestone May 23, 2023
@aiden-jeffrey
Copy link
Contributor

aiden-jeffrey commented May 23, 2023

  • Use three.js' MapControls which pans along the camera's "up" direction rather than in screen space.
  • Use the "Ellipsoid" class to derive latitude, longitude, and surface normal from the camera position position so we can adjust the plane the map controls pans on based on the position.

Note that MapControls projects the camera up onto the y=0 plane and pans along that vector. This is one of the main reasons I added the GlobeOrbitControls fork of OrbitControls - so that the camera pans along the surface of the ellipsoid (as per your second bullet).

  • Perhaps keeping the camera far fixed at the perpendicular plane at the earth's center is good enough?

I tried that and it still loaded many more tiles than if i set it closer to the surface of the planet (when zoomed in).

@gkjohnson
Copy link
Contributor Author

Note that MapControls projects the camera up onto the y=0 plane and pans along that vector.

Did you try adjusting camera.up? The docs say that MapControls pan orthogonal to the cameras up direction:

https://threejs.org/docs/?q=map#examples/en/controls/MapControls.screenSpacePanning

@aiden-jeffrey
Copy link
Contributor

Did you try adjusting camera.up? The docs say that MapControls pan orthogonal to the cameras up direction:

Yes, but the panLeft function needs patching to support the same functionality, so I don't think there's any way around forking. See my changes here: https://github.com/NASA-AMMOS/3DTilesRendererJS/blob/master/example/GlobeOrbitControls.js#L412

@aiden-jeffrey
Copy link
Contributor

Did you try adjusting camera.up? The docs say that MapControls pan orthogonal to the cameras up direction:

Also, I don't think camera.up ever gets updated (it's always normalised y vector).

@gkjohnson
Copy link
Contributor Author

Also, I don't think camera.up ever gets updated (it's always normalised y vector).

Object3D.up is a configurable value - you have to change it.

@gkjohnson
Copy link
Contributor Author

Closing in favor of other issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants