Plane climbs and exits fully off-screen

py was descending +7→+2, now ascending -1→+12 so the plane gains
altitude across the traversal. px stretched 18→-22 (was 16→-16) so
both endpoints sit clearly outside the visible frustum (camera at
z=22 + 40° vfov gives ~28 world-units of visible width on a 16:9
viewport). Pitch flipped from negative to +0.20 + p·0.10 to read
as nose-up for the climb. Roll/yaw unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MVA Global Fret 2026-05-05 12:24:03 +02:00
parent a23ef5edc3
commit 390e075371

View File

@ -125,21 +125,21 @@ function tick() {
root.style.setProperty('--mx', ((mouse.px - 0.5) * 2).toFixed(4)); root.style.setProperty('--mx', ((mouse.px - 0.5) * 2).toFixed(4));
root.style.setProperty('--my', ((mouse.py - 0.5) * 2).toFixed(4)); root.style.setProperty('--my', ((mouse.py - 0.5) * 2).toFixed(4));
/* Trajectoire droite gauche : /* Trajectoire droite gauche, en montée :
- p = 0 entre par la droite (hors champ) - p = 0 entre par la droite (légèrement bas)
- p = 0.5 traverse au centre haut - p = 0.5 traverse au centre, en train de monter
- p = 1 sort par la gauche (hors champ) - p = 1 sorti complètement, en haut-gauche hors champ
*/ */
const px = 16 - p * 32; const px = 18 - p * 40; // +18 → -22 (large marge de sortie)
const py = 7 - p * 5; const py = -1 + p * 13; // -1 → +12 (en montée, sort du cadre par le haut)
const bob = Math.sin(t * 0.9) * 0.12; const bob = Math.sin(t * 0.9) * 0.12;
planeHolder.position.set(px, py + bob, 0); planeHolder.position.set(px, py + bob, 0);
/* Banking subtil — direction inversée par rapport à un vol gauche→droite */ /* Banking — penche légèrement, nez vers le haut (montée) */
const targetRoll = 0.18 + (p - 0.5) * 0.25; const targetRoll = 0.18 + (p - 0.5) * 0.25; // .z = roulis
const targetPitch = -0.18 - p * 0.10; const targetPitch = 0.20 + p * 0.10; // .x = nez vers le haut (montée)
const targetYaw = -(p - 0.5) * 0.10; const targetYaw = -(p - 0.5) * 0.10; // .y = soupçon de yaw
planeHolder.rotation.z += (targetRoll - planeHolder.rotation.z) * 0.08; planeHolder.rotation.z += (targetRoll - planeHolder.rotation.z) * 0.08;
planeHolder.rotation.x += (targetPitch - planeHolder.rotation.x) * 0.08; planeHolder.rotation.x += (targetPitch - planeHolder.rotation.x) * 0.08;
planeHolder.rotation.y += (targetYaw - planeHolder.rotation.y) * 0.08; planeHolder.rotation.y += (targetYaw - planeHolder.rotation.y) * 0.08;