Revert canvas axis swap, try original drawing formula
User reports NS axis mirror with current swap. Try the original formula (canvasY = (lng + halfLong + 0.5)*TILE_SIZE) without swapping. UNPACK_FLIP_Y_WEBGL stays true so text still reads right-side up; just see if the user's visual expectations match this simpler arrangement.
This commit is contained in:
1 parent
2fd394a865
commit
eeb2e3e5f6
1 file changed
+2
-7
Vendored
+2
-7
@@ -328,13 +328,8 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) {
|
|||||||
// (vertical) and perp along canvas X (horizontal). This way the
|
// (vertical) and perp along canvas X (horizontal). This way the
|
||||||
// corridor's long axis (flight direction +Z) appears as a vertical
|
// corridor's long axis (flight direction +Z) appears as a vertical
|
||||||
// strip on canvas, matching the way depth maps on screen.
|
// strip on canvas, matching the way depth maps on screen.
|
||||||
// With UNPACK_FLIP_Y_WEBGL=true, canvas top -> texture V=1 (screen top).
|
var canvasX = (perp + halfPerp + 0.5) * GROUND_TILE_SIZE;
|
||||||
// We want lng=+12 (corridor north/front, ahead of camera) at screen top.
|
var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE;
|
||||||
// So canvasY is inverted: small Y = high lng (north).
|
|
||||||
// Same idea for perp: world east (dx > 0) should be on screen right,
|
|
||||||
// so canvasX is also inverted: large X = perp < 0 = dx > 0 = east.
|
|
||||||
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) {
|
if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) {
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user