update
This commit is contained in:
parent
b7523758e2
commit
d2ca83395f
@ -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 }
|
||||
}
|
||||
|
||||
//设置地板大小,由于后面将要生成墙体存在设置为1的厚度,因此这里对地板的x,z均-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);
|
||||
|
Loading…
Reference in New Issue
Block a user