Fix: production build
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import * as THREE from 'three';
|
||||
import { state } from '../state.js';
|
||||
import wallTextureUrl from '/textures/wall.jpg';
|
||||
|
||||
export function createRoomWalls() {
|
||||
const wallTexture = state.loader.load('/textures/wall.jpg');
|
||||
const wallTexture = state.loader.load(wallTextureUrl);
|
||||
wallTexture.wrapS = THREE.RepeatWrapping;
|
||||
wallTexture.wrapT = THREE.RepeatWrapping;
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ import { createBookshelf } from './bookshelf.js';
|
||||
import { createDoor } from './door.js';
|
||||
import { createTvSet } from './tv-set.js';
|
||||
import { PictureFrame } from './PictureFrame.js';
|
||||
import painting1 from '/textures/painting1.jpg';
|
||||
import painting2 from '/textures/painting2.jpg';
|
||||
import floorTextureUrl from '/textures/floor.jpg';
|
||||
|
||||
// --- Scene Modeling Function ---
|
||||
export function createSceneObjects() {
|
||||
@@ -17,7 +20,7 @@ export function createSceneObjects() {
|
||||
|
||||
// --- 1. Floor ---
|
||||
const floorGeometry = new THREE.PlaneGeometry(20, 20);
|
||||
const floorTexture = state.loader.load('/textures/floor.jpg');
|
||||
const floorTexture = state.loader.load(floorTextureUrl);
|
||||
floorTexture.wrapS = THREE.RepeatWrapping;
|
||||
floorTexture.wrapT = THREE.RepeatWrapping;
|
||||
floorTexture.repeat.set(state.roomSize, state.roomSize);
|
||||
@@ -139,7 +142,7 @@ export function createSceneObjects() {
|
||||
position: new THREE.Vector3(-state.roomSize/2 + 0.1, 2.0, -state.roomSize/2 + 1.5),
|
||||
width: 1.5,
|
||||
height: 1,
|
||||
imageUrls: ['/textures/painting1.jpg', '/textures/painting2.jpg'],
|
||||
imageUrls: [painting1, painting2],
|
||||
rotationY: Math.PI / 2
|
||||
});
|
||||
state.pictureFrames.push(pictureFrame);
|
||||
@@ -148,7 +151,7 @@ export function createSceneObjects() {
|
||||
position: new THREE.Vector3(state.roomSize/2 - 0.1, 2.0, 0.5),
|
||||
width: 1.5,
|
||||
height: 1,
|
||||
imageUrls: ['/textures/painting2.jpg', '/textures/painting1.jpg'],
|
||||
imageUrls: [painting2, painting1],
|
||||
rotationY: -Math.PI / 2
|
||||
});
|
||||
state.pictureFrames.push(pictureFrame2);
|
||||
|
||||
Reference in New Issue
Block a user