From 73920d0ce8c704b7bb171d7d15402a59abe08179 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 8 Oct 2026 07:41:14 +0200 Subject: [PATCH] Both axes without swap: UNPACK flip for Y only User clarified: - x must decrease left to right (east at screen left, high x left) - y must decrease in flight direction (south at front, low y in flight dir) With no swap on canvasY (lng+halfLong+0.5 formula) and UNPACK flip=true, canvas top -> texture top -> screen top. canvas bottom -> screen bottom. So: - lng=+12 (north, ahead in N flight) -> canvasY=6272 (bottom) -> screen bottom. User at screen bottom sees north tiles = high y - south tiles at canvas top -> screen top. User at screen top sees south tiles = low y. y decreases in flight direction (looking forward = top of screen = low y). With no swap on canvasX: - perp=-2 (east, dx=+2) -> canvasX=128 (left) - After WebGL (no X flip): east at screen left, west at screen right. x decreases left to right (east at left, west at right). --- vendor/clouds3d.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index bb76aec..d524183 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -334,7 +334,7 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) { // For perp axis (X): keep the natural sign so world east (dx>0) // ends up at canvasX > halfPerp area (right side of canvas). 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) { return Promise.resolve(false); }