fix: flip camera parallax rotation to match mouse direction (#9)
This commit is contained in:
+2
-2
@@ -34,10 +34,10 @@ export function createParallaxCamera(camera: THREE.PerspectiveCamera): ParallaxC
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Target rotation about Y (≈ ±5°).
|
// 2. Target rotation about Y (≈ ±5°).
|
||||||
let targetY = mouseX * 0.087;
|
let targetY = -mouseX * 0.087;
|
||||||
|
|
||||||
// 3. Target rotation about X (≈ ±1°).
|
// 3. Target rotation about X (≈ ±1°).
|
||||||
const targetX = mouseY * 0.02;
|
const targetX = -mouseY * 0.02;
|
||||||
|
|
||||||
// 4. Target z offset (parallax push away/toward the tank).
|
// 4. Target z offset (parallax push away/toward the tank).
|
||||||
const targetZ = mouseX * 0.1;
|
const targetZ = mouseX * 0.1;
|
||||||
|
|||||||
Reference in New Issue
Block a user