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:
@@ -1415,12 +1415,16 @@ export class IsoRenderer {
|
||||
const fi = pr * segs;
|
||||
const i0 = Math.min(segs - 1, Math.floor(fi));
|
||||
const f = fi - i0;
|
||||
const bx = pts[i0].x + (pts[i0 + 1].x - pts[i0].x) * f;
|
||||
const by = pts[i0].y + (pts[i0 + 1].y - pts[i0].y) * f - 4;
|
||||
const ang = Math.atan2(pts[i0 + 1].y - pts[i0].y, pts[i0 + 1].x - pts[i0].x);
|
||||
const sdx = pts[i0 + 1].x - pts[i0].x;
|
||||
const sdy = pts[i0 + 1].y - pts[i0].y;
|
||||
const bx = pts[i0].x + sdx * f;
|
||||
const by = pts[i0].y + sdy * f - 4;
|
||||
ctx.save();
|
||||
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
|
||||
ctx.strokeStyle = '#2f3e46'; ctx.lineWidth = 1.1;
|
||||
ctx.beginPath(); ctx.arc(-3.2, 1.5, 2.1, 0, 7); ctx.stroke();
|
||||
|
||||
Reference in New Issue
Block a user