Compare commits

...

3 Commits

Author SHA1 Message Date
Dejvino
fd08d223ae Camera movement tweaks 2025-11-09 08:06:06 +01:00
Dejvino
af9100dc62 Light toned down 2025-11-09 00:20:26 +01:00
Dejvino
f774e3c126 Fix pizza box, add cassette box 2025-11-09 00:13:05 +01:00

View File

@ -61,9 +61,9 @@
let videoUrls = []; // Array to hold all video URLs
let currentVideoIndex = -1; // Index of the currently playing video
const originalLampIntensity = 1.5; // Base intensity for the flickering lamp
const originalLampIntensity = 0.8; // Base intensity for the flickering lamp
const originalScreenIntensity = 0.2; // Base intensity for the screen glow
const screenIntensityPulse = 0.4;
const screenIntensityPulse = 0.2;
const roomSize = 5;
const roomHeight = 3;
@ -141,7 +141,7 @@
const ambientLight = new THREE.AmbientLight(0x111111);
scene.add(ambientLight);
const roomLight = new THREE.PointLight(0xffaa55, 0.2, roomSize);
const roomLight = new THREE.PointLight(0xffaa55, 0.05, roomSize);
roomLight.position.set(0, 1.8, 0);
scene.add(roomLight);
@ -694,15 +694,24 @@
cameraMesh.castShadow = true; cameraMesh.receiveShadow = true;
scene.add(cameraMesh);
// --- 8. Pizza Box (On the table) ---
// --- 8. Pizza Box ---
const boxGeometry = new THREE.BoxGeometry(0.5, 0.05, 0.5);
const boxMaterial = new THREE.MeshPhongMaterial({ color: 0xe0c896, shininess: 5 });
const pizzaBox = new THREE.Mesh(boxGeometry, boxMaterial);
pizzaBox.position.set(1.8, 0.7 + 0.025, 0.8);
pizzaBox.position.set(-1.8, 0.025, -0.8);
pizzaBox.rotation.y = Math.PI / 5;
pizzaBox.castShadow = true; pizzaBox.receiveShadow = true;
scene.add(pizzaBox);
// --- 8. Cassette ---
const cassetteGeometry = new THREE.BoxGeometry(0.2, 0.05, 0.45);
const cassetteMaterial = new THREE.MeshPhongMaterial({ color: 0xe0c896, shininess: 5 });
const cassette = new THREE.Mesh(cassetteGeometry, cassetteMaterial);
cassette.position.set(-0.5, 0.025, -1.4);
cassette.rotation.y = Math.PI / 3;
cassette.castShadow = true; cassette.receiveShadow = true;
scene.add(cassette);
createDoor(roomSize/2, -roomSize/2 * 0.5, -Math.PI/2);
createBookshelf(-roomSize/2 + 0.2, roomSize/2*0.2, Math.PI/2, 0);
createBookshelf(-roomSize/2 + 0.2, roomSize/2*0.7, Math.PI/2, 0);
@ -1341,26 +1350,27 @@
const globalTime = Date.now() * 0.00005;
const lookAtTime = Date.now() * 0.00003;
const camAmplitude = 0.6;
const camAmplitude = 0.7;
const lookAmplitude = 0.05;
// Base Camera Position in front of the TV
const baseX = 0;
const baseX = -0.5;
const baseY = 1.5;
const baseZ = 3;
const baseZ = 2.5;
// Base LookAt target (Center of the screen)
const baseTargetX = -1;
const baseTargetX = -0.7;
const baseTargetY = 1.7;
const baseTargetZ = -0.96;
const baseTargetZ = -0.3;
// Camera Position Offsets (Drift)
const camOffsetX = Math.sin(globalTime * 3.1) * camAmplitude;
const camOffsetY = Math.cos(globalTime * 2.5) * camAmplitude * 0.4;
const camOffsetZ = Math.cos(globalTime * 3.2) * camAmplitude * 1.4;
camera.position.x = baseX + camOffsetX;
camera.position.y = baseY + camOffsetY;
camera.position.z = baseZ;
camera.position.z = baseZ + camOffsetZ;
// LookAt Target Offsets (Subtle Gaze Shift)
const lookOffsetX = Math.sin(lookAtTime * 1.5) * lookAmplitude;