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.
This commit is contained in:
Richard Zink committed 2026-10-08 09:51:32 +02:00
1 parent b5b169ae80
commit 20ac76e0b1
1 file changed
+5 -3
+5 -3
View File
@@ -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). // 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 // For lng axis (Y): invert canvasY so lng=+12 (corridor front in
// N flight) lands at small canvasY (= screen top after flip). // N flight) lands at small canvasY (= screen top after flip).
// === X-SWAP BUILD v3 === // X-swap: east (perp=-2) -> canvasX 1152 (right) // === NATURAL ORDER BUILD v4 ===
// ends up at canvasX > halfPerp area (right side of canvas). // No X-swap: east (perp=-2) -> canvasX 128 (left of canvas),
var canvasX = (-perp + halfPerp + 0.5) * GROUND_TILE_SIZE; // 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; var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE;
if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) { if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) {
return Promise.resolve(false); return Promise.resolve(false);