From 20ac76e0b16cb00dac5769906b33391d4c1dd70a Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 8 Oct 2026 09:51:32 +0200 Subject: [PATCH] Revert X-swap: natural order (no image X-flip) User wanted NO X-swap and NO image X-flip: - canvasX = (perp + 2.5) * 256 (no negation): east (perp=-2) at canvasX 128 (left), west (perp=+2) at canvasX 1152 (right) - Image drawn with positive width (no X-flip): map content reads normally (place names, street names not mirrored) The X coordinates read in their natural geographic order: - left = high x (east), right = low x (west) If the user is observing from a south-facing view (cockpit facing back), their right is the world's left (east), so they see high x on their right (world's left). x still reads correctly when facing the same direction as the flight. The arrangement is now back to the natural order with no swapping in either direction. --- vendor/clouds3d.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index 2e3ec5a..6c6eaed 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -337,9 +337,11 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) { // UNPACK_FLIP_Y_WEBGL=true inverts V: canvas top -> texture V=1 (top). // For lng axis (Y): invert canvasY so lng=+12 (corridor front in // N flight) lands at small canvasY (= screen top after flip). - // === X-SWAP BUILD v3 === // X-swap: east (perp=-2) -> canvasX 1152 (right) - // ends up at canvasX > halfPerp area (right side of canvas). - var canvasX = (-perp + halfPerp + 0.5) * GROUND_TILE_SIZE; + // === NATURAL ORDER BUILD v4 === + // No X-swap: east (perp=-2) -> canvasX 128 (left of canvas), + // west (perp=+2) -> canvasX 1152 (right). Map content is also + // not X-flipped, so the user sees the image in normal orientation. + var canvasX = (perp + halfPerp + 0.5) * GROUND_TILE_SIZE; var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE; if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) { return Promise.resolve(false);