Feature: add paintings

This commit is contained in:
Dejvino 2025-11-20 19:48:57 +01:00
parent ae3383986a
commit 2e8ad3ad25
4 changed files with 9 additions and 5 deletions

View File

@ -10,6 +10,7 @@ import { createRats } from './rat.js';
import { PictureFrame } from './PictureFrame.js'; import { PictureFrame } from './PictureFrame.js';
import painting1 from '/textures/painting1.jpg'; import painting1 from '/textures/painting1.jpg';
import painting2 from '/textures/painting2.jpg'; import painting2 from '/textures/painting2.jpg';
import painting3 from '/textures/painting3.jpg';
import floorTextureUrl from '/textures/stone_floor.png'; import floorTextureUrl from '/textures/stone_floor.png';
import tableTextureUrl from '/textures/wood.png'; import tableTextureUrl from '/textures/wood.png';
@ -147,6 +148,7 @@ export function createSceneObjects() {
createBookshelf(-state.roomSize/2 + 0.2, state.roomSize/2*0.7, Math.PI/2, 0); createBookshelf(-state.roomSize/2 + 0.2, state.roomSize/2*0.7, Math.PI/2, 0);
createBookshelf(-state.roomSize/2 * 0.7, -state.roomSize/2+0.3, 0, 1); createBookshelf(-state.roomSize/2 * 0.7, -state.roomSize/2+0.3, 0, 1);
// next to bookshelf
const pictureFrame = new PictureFrame(state.scene, { const pictureFrame = new PictureFrame(state.scene, {
position: new THREE.Vector3(-state.roomSize/2, 1.7, -state.roomSize/2 + 0.7), position: new THREE.Vector3(-state.roomSize/2, 1.7, -state.roomSize/2 + 0.7),
width: 0.7, width: 0.7,
@ -157,20 +159,22 @@ export function createSceneObjects() {
state.pictureFrames.push(pictureFrame); state.pictureFrames.push(pictureFrame);
// on fireplace
const pictureFrame2 = new PictureFrame(state.scene, { const pictureFrame2 = new PictureFrame(state.scene, {
position: new THREE.Vector3(state.roomSize/2 - 0.9, 1.7, -1.1), position: new THREE.Vector3(state.roomSize/2 - 0.9, 1.8, -1.1),
width: 0.8, width: 0.5,
height: 0.5, height: 0.7,
imageUrls: [painting2, painting1], imageUrls: [painting2, painting1, painting3],
rotationY: -Math.PI / 2 rotationY: -Math.PI / 2
}); });
state.pictureFrames.push(pictureFrame2); state.pictureFrames.push(pictureFrame2);
// next to fireplace
const pictureFrame3 = new PictureFrame(state.scene, { const pictureFrame3 = new PictureFrame(state.scene, {
position: new THREE.Vector3(state.roomSize/2, 1.7, 0.75), position: new THREE.Vector3(state.roomSize/2, 1.7, 0.75),
width: 0.7, width: 0.7,
height: 1.2, height: 1.2,
imageUrls: [painting2, painting1], imageUrls: [painting3, painting2, painting1, painting3],
rotationY: -Math.PI / 2 rotationY: -Math.PI / 2
}); });
state.pictureFrames.push(pictureFrame3); state.pictureFrames.push(pictureFrame3);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB