Draft for handling epsilon-dependence of orientation #11937
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This changes the
camera.lookAt
implementation so that the orientation does no longer depends (so strongly) on certain "epsilon" values of the target position. Some additonal details are laid out in #11488 .The fact that the title and the name of the branch contain the word
draft
should be a clear indicator:This is not supposed to be merged!
This should just serve as a basis for figuring out how to solve the issue sensibly.
As pointed out in the comments to the issue: There is no one-fits-all solution. The whole
zoomTo
-functionality just assumes that everything happens on the surface of the WGS84 ellipsoid. When a tileset has a distance of (0,0,100) or (5000,0,0) from the center of the ellipsoid, then trying to compute the ENU orientation from the point on the surface that is closest to this point hardly makes sense. Tilesets that are not "geolocated" (but have their center at the origin) will usually not be handled gracefully by that function. But basically every Sandcastle in the world will use thezoomTo
/flyTo
functionality. So every change here will inevitably be a "breaking change" in terms of the behavior.That said .... what is currently implemented here will do the following:
target
(i.e. the center of the bounding sphere to zoom to) to the origin.target
(based on theoffset
that is passed in)In terms of "testing", I focussed on the case of a tileset with a bounding sphere that covers the whole earth, but is centered at different positions. These are created (on the fly) in the sandcastle that is given below, with the
lines.
Some examples of the old behavior, showing that the orientation strongly depends on that magic "epsilon":
Some examples of the new behavior:
To emphasize this again: This is not a 'proposed solution'. The approach feels pretty arbitrary, and I could come up with a million cases where this will lead to "unexpected results". (And the functionality of
flyTo
is not covered here at all...)The goal is mainly to encourage people to chime in, saying what could be "The Right Orientation" for each of the
createSampleOption
cases in this sandcastle:Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change