Compare commits
3 Commits
4784d5ee26
...
fd08d223ae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd08d223ae | ||
|
|
af9100dc62 | ||
|
|
f774e3c126 |
@ -61,9 +61,9 @@
|
|||||||
let videoUrls = []; // Array to hold all video URLs
|
let videoUrls = []; // Array to hold all video URLs
|
||||||
let currentVideoIndex = -1; // Index of the currently playing video
|
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 originalScreenIntensity = 0.2; // Base intensity for the screen glow
|
||||||
const screenIntensityPulse = 0.4;
|
const screenIntensityPulse = 0.2;
|
||||||
|
|
||||||
const roomSize = 5;
|
const roomSize = 5;
|
||||||
const roomHeight = 3;
|
const roomHeight = 3;
|
||||||
@ -141,7 +141,7 @@
|
|||||||
const ambientLight = new THREE.AmbientLight(0x111111);
|
const ambientLight = new THREE.AmbientLight(0x111111);
|
||||||
scene.add(ambientLight);
|
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);
|
roomLight.position.set(0, 1.8, 0);
|
||||||
scene.add(roomLight);
|
scene.add(roomLight);
|
||||||
|
|
||||||
@ -694,15 +694,24 @@
|
|||||||
cameraMesh.castShadow = true; cameraMesh.receiveShadow = true;
|
cameraMesh.castShadow = true; cameraMesh.receiveShadow = true;
|
||||||
scene.add(cameraMesh);
|
scene.add(cameraMesh);
|
||||||
|
|
||||||
// --- 8. Pizza Box (On the table) ---
|
// --- 8. Pizza Box ---
|
||||||
const boxGeometry = new THREE.BoxGeometry(0.5, 0.05, 0.5);
|
const boxGeometry = new THREE.BoxGeometry(0.5, 0.05, 0.5);
|
||||||
const boxMaterial = new THREE.MeshPhongMaterial({ color: 0xe0c896, shininess: 5 });
|
const boxMaterial = new THREE.MeshPhongMaterial({ color: 0xe0c896, shininess: 5 });
|
||||||
const pizzaBox = new THREE.Mesh(boxGeometry, boxMaterial);
|
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.rotation.y = Math.PI / 5;
|
||||||
pizzaBox.castShadow = true; pizzaBox.receiveShadow = true;
|
pizzaBox.castShadow = true; pizzaBox.receiveShadow = true;
|
||||||
scene.add(pizzaBox);
|
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);
|
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.2, Math.PI/2, 0);
|
||||||
createBookshelf(-roomSize/2 + 0.2, roomSize/2*0.7, 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 globalTime = Date.now() * 0.00005;
|
||||||
const lookAtTime = Date.now() * 0.00003;
|
const lookAtTime = Date.now() * 0.00003;
|
||||||
|
|
||||||
const camAmplitude = 0.6;
|
const camAmplitude = 0.7;
|
||||||
const lookAmplitude = 0.05;
|
const lookAmplitude = 0.05;
|
||||||
|
|
||||||
// Base Camera Position in front of the TV
|
// Base Camera Position in front of the TV
|
||||||
const baseX = 0;
|
const baseX = -0.5;
|
||||||
const baseY = 1.5;
|
const baseY = 1.5;
|
||||||
const baseZ = 3;
|
const baseZ = 2.5;
|
||||||
|
|
||||||
// Base LookAt target (Center of the screen)
|
// Base LookAt target (Center of the screen)
|
||||||
const baseTargetX = -1;
|
const baseTargetX = -0.7;
|
||||||
const baseTargetY = 1.7;
|
const baseTargetY = 1.7;
|
||||||
const baseTargetZ = -0.96;
|
const baseTargetZ = -0.3;
|
||||||
|
|
||||||
// Camera Position Offsets (Drift)
|
// Camera Position Offsets (Drift)
|
||||||
const camOffsetX = Math.sin(globalTime * 3.1) * camAmplitude;
|
const camOffsetX = Math.sin(globalTime * 3.1) * camAmplitude;
|
||||||
const camOffsetY = Math.cos(globalTime * 2.5) * camAmplitude * 0.4;
|
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.x = baseX + camOffsetX;
|
||||||
camera.position.y = baseY + camOffsetY;
|
camera.position.y = baseY + camOffsetY;
|
||||||
camera.position.z = baseZ;
|
camera.position.z = baseZ + camOffsetZ;
|
||||||
|
|
||||||
// LookAt Target Offsets (Subtle Gaze Shift)
|
// LookAt Target Offsets (Subtle Gaze Shift)
|
||||||
const lookOffsetX = Math.sin(lookAtTime * 1.5) * lookAmplitude;
|
const lookOffsetX = Math.sin(lookAtTime * 1.5) * lookAmplitude;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user