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
As described in #12769 , draping imagery on 3D Tiles does currently not work for tiles that cross the antimeridian. There are several factors that contribute to this vague concept of "not working". Some of them have been mentioned in #12769 (comment) .
This DRAFT PR contains a few commits that address these points, but there are many follow-up changes that are not integrated here yet.
BoundingRectangle.fromRectangle
function does not work for this case. So as a follow-up-fix, there is a new function to compute the bounding rectangle from a rectangle, added in 22cadc1minX = 999, maxX = 1
for this range, then this will be turned intominX = 999, maxX = 1001
and the receiver has to wrap this, to receive the actual imagery tile coordinates 999, 0, 1. This is done in 267fe47ImageryCoverage
objects. But the rectangles that are involved here are converted into their "native" representation. And theRectangle.computeWidth
function is broken for this case. An attempt to provide a function to compute the necessary texture coordinates is drafted in ee5dcdd . This operates on "non-native" rectangles (i.e. on realRectangle
objects that actually do follow the constraints that are described in theRectangle
class). This part even involves a few unit tests, because ... why not? Whether or not the computation of the texture coordinates can or should happen based on the "non-native" rectangles, or whether it must happen based on the "native" rectangles is not yet clear to me. Given that all this aims at relative coordinates, I think that it should be possible to implement that based on "any" rectangle. But maybe there are some sorts of distortions from the projection that wouldn't be taken into account based on "real" rectangles...? In any case, certain inlined clipping, clamping, and conversion steps that have been taken from the terrain imagery implementation will have to be reviewed for this.The current state contains several logs and places that are marked with comments saying that they may require further review or follow-up fixes.
Issue number and link
Addresses #12769
Testing plan
None yet
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change