Tourismustal: Biker fahren richtig herum (Flip statt Vollrotation)

Bildschirm-Winkel bergab ist ~140 Grad - volle Rotation stellte die
Fahrer auf den Kopf bzw. aufs Vorderrad. Jetzt: Spiegelung nach
Fahrtrichtung + leichte Bergab-Neigung (Faktor 0.3).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 23:38:43 +02:00
parent cfdfa4bb28
commit 272c5a7169
+8 -4
View File
@@ -1415,12 +1415,16 @@ export class IsoRenderer {
const fi = pr * segs; const fi = pr * segs;
const i0 = Math.min(segs - 1, Math.floor(fi)); const i0 = Math.min(segs - 1, Math.floor(fi));
const f = fi - i0; const f = fi - i0;
const bx = pts[i0].x + (pts[i0 + 1].x - pts[i0].x) * f; const sdx = pts[i0 + 1].x - pts[i0].x;
const by = pts[i0].y + (pts[i0 + 1].y - pts[i0].y) * f - 4; const sdy = pts[i0 + 1].y - pts[i0].y;
const ang = Math.atan2(pts[i0 + 1].y - pts[i0].y, pts[i0 + 1].x - pts[i0].x); const bx = pts[i0].x + sdx * f;
const by = pts[i0].y + sdy * f - 4;
ctx.save(); ctx.save();
ctx.translate(bx, by); ctx.translate(bx, by);
ctx.rotate(ang * 0.45); // Blickrichtung: Rad zeigt in Fahrtrichtung (spiegeln statt rotieren),
// dazu nur eine LEICHTE Bergab-Neigung sonst stehen sie kopf.
ctx.scale(sdx < 0 ? -1 : 1, 1);
ctx.rotate(Math.atan2(sdy, Math.abs(sdx) || 0.01) * 0.3);
// Räder // Räder
ctx.strokeStyle = '#2f3e46'; ctx.lineWidth = 1.1; ctx.strokeStyle = '#2f3e46'; ctx.lineWidth = 1.1;
ctx.beginPath(); ctx.arc(-3.2, 1.5, 2.1, 0, 7); ctx.stroke(); ctx.beginPath(); ctx.arc(-3.2, 1.5, 2.1, 0, 7); ctx.stroke();