This commit is contained in:
hzz 2024-05-21 14:06:25 +08:00
parent b7523758e2
commit d2ca83395f

View File

@ -1058,11 +1058,18 @@ function createTitleFloor(houseName: string, baseWidth: number, baseLength: numb
}
//
function createFloor(houseName: string, baseWidth: number, baseLength: number, position: positionType, wood:any = requires.wood) {
function createFloor(houseName: string, baseWidth: number, baseLength: number, position: positionType, wood:any = "") {
let obj = {}
if (wood == "") {
const texture = new THREE.TextureLoader().load(wood);
obj = { map: texture, transparent: true }
} else {
obj = { color: wood }
}
//1xz-2
const floor = new THREE.BoxGeometry(baseWidth - 2, 1, baseLength);
const material = new THREE.MeshPhongMaterial({ map: texture, transparent: true });
const material = new THREE.MeshPhongMaterial(obj);
const mesh = new THREE.Mesh(floor, material);
const { x, y, z } = position
mesh.position.set(x, y + 1 / 2, z);