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

Improve camera fly to for entities clamped to the ground? #9115

Open
OmarShehata opened this issue Aug 26, 2020 · 2 comments
Open

Improve camera fly to for entities clamped to the ground? #9115

OmarShehata opened this issue Aug 26, 2020 · 2 comments

Comments

@OmarShehata
Copy link
Contributor

Initially discussed on the forum here: https://community.cesium.com/t/bounding-sphere-for-polygons-ellipses-on-ground-incorrectly-computed/10662. The summary is that the camera can't always fly to entities clamped to the ground as expected because entities are clamped in the shader, so there isn't a specific "position on the ground" they can be found at (an entity may in fact be half on a cliff wall and half on the ground).

This is a common need and rather difficult to work around on the application side, @lilleyse recommended opening to discuss potential ways to improve this on the CesiumJS side.

Here's a Sandcastle showing the workaround I ended up doing in a client application.

  • Flying directly to the polygon, you can't see it because the min/max difference in terrain height in this area is very large
  • Getting the position and sampling the terrain involves extracting the positions from the polygon entity to get its position and size. So an application would need to do this logic specific for each geometry type. I also ran into this bug doing this: Ellipse on ground has hole in it when camera is perfectly perpendicular to ground #9114.
  • I ended up creating an invisible sphere entity and having the camera fly there so it automatically flies at a nice distance/angle.
@lilleyse
Copy link
Contributor

One idea is to get a better bounding volume by using ApproximateTerrainHeights. However this won't necessarily work well if the ground primitive is on top of 3D Tiles.

@ggetz
Copy link
Contributor

ggetz commented Nov 7, 2024

CC #8480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants