commit 35b0fc20ed38f25957540280bbbab655cdd428a9
parent 066972e9665df17648047be1f51fe68faeea8330
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date: Thu, 4 Jul 2024 14:25:33 -0300
add first person camera
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/tp/src/scene.js b/tp/src/scene.js
@@ -91,6 +91,14 @@ function setupThreeJs() {
const controls = new OrbitControls(topView, renderer.domElement);
+ const firstPersonCamera = new THREE.PerspectiveCamera(
+ 50, window.innerWidth / window.innerHeight, 0.1, 1000);
+
+ firstPersonCamera.position.set(0, 5, 0);
+ firstPersonCamera.lookAt(1000, 0, 0);
+ firstPersonCamera.name = "firstPersonCamera"
+ cameras.push(firstPersonCamera);
+
const ambientLight = new THREE.AmbientLight(0xFFFFFF);
scene.add(ambientLight);