diff --git a/js/intro-scene.js b/js/intro-scene.js index 03e9271..8e7a280 100644 --- a/js/intro-scene.js +++ b/js/intro-scene.js @@ -125,26 +125,25 @@ 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 descente (approche) : - - p = 0 → entre haut-droite (hors champ) - - p = 0.5 → traverse en diagonale descendante - - p = 1 → sort bas-gauche (hors champ) + /* Trajectoire droite → gauche, en très légère montée : + - p = 0 → entre par la droite à mi-hauteur haute (y ≈ 3.5) + - p = 0.5 → traverse à y ≈ 4.25 + - p = 1 → sort par la gauche un peu plus haut (y ≈ 5) + Pente ≈ 1.5/40 ≈ 2° (presque horizontal). */ - 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; + const px = 18 - p * 40; // +18 → -22 (toujours bien hors champ aux deux bouts) + const py = 3.5 + p * 1.5; // +3.5 → +5 (douce montée) + const bob = Math.sin(t * 0.9) * 0.08; planeHolder.position.set(px, py + bob, 0); - /* 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. + /* Avec nez à -X et up = +Y : + - rotation.z = PITCH (négatif = nez en l'air) + - rotation.x = ROLL + Pente de 2° → on relève le nez légèrement pour suivre la trajectoire. */ - 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 targetPitch = -0.06 - p * 0.01; // nez ~3.5°-4° en l'air + const targetRoll = 0.04 + (p - 0.5) * 0.04; // roulis très subtil const targetYaw = 0; planeHolder.rotation.z += (targetPitch - planeHolder.rotation.z) * 0.08; planeHolder.rotation.x += (targetRoll - planeHolder.rotation.x) * 0.08;