Unify 3D mercator camera projection; hide route layer under globe - #165
Merged
Conversation
Both the aircraft and route 3D layers built the same mainMatrix × origin-translation × meter-scale camera projection inline. Extract it into mercatorUtils so the two layers can't drift apart, with tests covering the projection math directly.
Aircraft3DTransforms and AircraftRoute3DRenderer now build their mercator camera projection through the shared helper instead of two independent inline copies. This lets the route layer drop its rotateX(PI/2) + scale(1,1,-1) mirror trick in favor of the aircraft layer's plain rotation with a uniform positive camera scale, so both layers agree on orientation without mirroring texture content. The route layer's scene math is mercator-only (mainMatrix means something different under globe projection, which it can't yet handle), so it now explicitly hides its geometry in globe projection instead of projecting it to bogus screen positions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
mercatorCameraMatrixhelper inmercatorUtils.ts, with tests.rotateX(PI/2)scene group with uniform positive camera scale, removing the route layer'sscale(1,1,-1)mirror trick — the two layers now agree on orientation math instead of arriving at the same result via different formulations.