diff --git a/js/intro-scene.js b/js/intro-scene.js index df5c0d2..03e9271 100644 --- a/js/intro-scene.js +++ b/js/intro-scene.js @@ -125,24 +125,26 @@ function tick() { root.style.setProperty('--mx', ((mouse.px - 0.5) * 2).toFixed(4)); root.style.setProperty('--my', ((mouse.py - 0.5) * 2).toFixed(4)); - /* Trajectoire droite → gauche, en montée : - - p = 0 → entre par la droite (légèrement bas) - - p = 0.5 → traverse au centre, en train de monter - - p = 1 → sorti complètement, en haut-gauche hors champ + /* Trajectoire droite → gauche, en descente (approche) : + - p = 0 → entre haut-droite (hors champ) + - p = 0.5 → traverse en diagonale descendante + - p = 1 → sort bas-gauche (hors champ) */ - const px = 18 - p * 40; // +18 → -22 (large marge de sortie) - 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 px = 18 - p * 40; // +18 → -22 + const py = 6 - p * 16; // +6 (haut) → -10 (bas hors champ) + const bob = Math.sin(t * 0.9) * 0.10; planeHolder.position.set(px, py + bob, 0); - /* Pour un avion volant -X (nose à gauche), avec up = +Y : - - rotation.z (axe latéral du monde) = PITCH. Négatif → nez en l'air. + /* Pour un avion volant -X (nez à gauche), avec up = +Y : + - rotation.z (axe latéral du monde) = PITCH. Positif → nez baissé. - rotation.x (axe longitudinal du monde) = ROLL. - rotation.y (axe vertical du monde) = YAW. + Slope de la trajectoire ≈ -16/40 = -22° → on incline le nez de + manière analogue pour suivre la pente. */ - const targetPitch = -0.30 - p * 0.05; // ~17°-20° nez en l'air (montée) - const targetRoll = 0.12 + (p - 0.5) * 0.10; // léger roulis + const targetPitch = 0.32 + p * 0.05; // nez en bas ~18°-21° (descente) + const targetRoll = 0.12 + (p - 0.5) * 0.10; // léger roulis const targetYaw = 0; planeHolder.rotation.z += (targetPitch - planeHolder.rotation.z) * 0.08; planeHolder.rotation.x += (targetRoll - planeHolder.rotation.x) * 0.08;