Kaynağa Gözat

新增模型修改地板

zjs_project 1 yıl önce
ebeveyn
işleme
f7af4ef6ed
2 değiştirilmiş dosya ile 6 ekleme ve 4 silme
  1. 5 4
      src/mixins/floorMethod.js
  2. 1 0
      src/static/layoutModelData.js

+ 5 - 4
src/mixins/floorMethod.js

@@ -154,7 +154,8 @@ export default {
 				//使用纹理贴图材质
 				texture.repeat.set(scaleX, scaleY);
 				
-				let geometry = new THREE.PlaneGeometry(obj.spaceWidth/100, obj.spaceHeight/100);
+				// let geometry = new THREE.PlaneGeometry(obj.spaceWidth/100, obj.spaceHeight/100);
+				let geometry = new THREE.BoxGeometry(obj.spaceWidth/100,0.1, obj.spaceHeight/100);
 				let material = new THREE.MeshBasicMaterial({ map: texture });
 				let cube = new THREE.Mesh(geometry, material);
 				
@@ -162,9 +163,9 @@ export default {
 				cube.userType = "mesh";
 				cube.userData = obj;//位置数据
 				// 设置位置,旋转,缩放
-				cube.position.set(positionX, -0.01, -positionY);
-				cube.rotation.x = -Math.PI / 2 ;  // 旋转 180 度
-				cube.receiveShadow = true;//材质是否接收阴影
+				cube.position.set(positionX, -0.11, -positionY);
+				// cube.rotation.x = -Math.PI / 2 ;  // 旋转 180 度 PlaneGeometry 生效
+				// cube.receiveShadow = true;//材质是否接收阴影
 				
 				//注释掉,不让草地进入空间列表中,不触发空间变化的动画过程,规避掉动画过程中的问题
 				// let md = {

+ 1 - 0
src/static/layoutModelData.js

@@ -159,6 +159,7 @@ var layoutModel = [
 	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_XSPACE_deng_01.glb', name: '吊顶灯',modelName: 'BP_XSPACE_deng_01', type:2},
 	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_L_CeilingLamp_01.glb', name: '吊灯01',modelName: 'BP_L_CeilingLamp_01', type:2},
 	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_L_FloorLamp01.glb', name: '地灯05',modelName: 'BP_L_FloorLamp01', type:2},
+	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_L_CeilingLamp_02.glb', name: '吊灯02',modelName: 'BP_L_CeilingLamp_02', type:2},
 ];
 
 module.exports = layoutModel;