Skip to content

Unify 3D mercator camera projection; hide route layer under globe - #165

Merged
amorfinv merged 2 commits into
mainfrom
fix/mercator-camera-dedup
Aug 8, 2026
Merged

Unify 3D mercator camera projection; hide route layer under globe#165
amorfinv merged 2 commits into
mainfrom
fix/mercator-camera-dedup

Conversation

@amorfinv

@amorfinv amorfinv commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extract the duplicated mainMatrix × origin-translation × meter-scale camera projection (used by both the aircraft and route 3D layers) into a shared mercatorCameraMatrix helper in mercatorUtils.ts, with tests.
  • Switch both layers to a plain rotateX(PI/2) scene group with uniform positive camera scale, removing the route layer's scale(1,1,-1) mirror trick — the two layers now agree on orientation math instead of arriving at the same result via different formulations.
  • Fix: the route layer now hides its geometry under globe projection instead of projecting it with mercator-only matrix math (which produced bogus screen positions), since real globe support isn't implemented yet.

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.
@amorfinv
amorfinv merged commit aa1e22a into main Aug 8, 2026
2 checks passed
@amorfinv
amorfinv deleted the fix/mercator-camera-dedup branch August 8, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant