From d12d58f9df8a8a05466496e12f2dbd02e8f51a31 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 05 五月 2024 16:29:49 +0800
Subject: [PATCH] #

---
 src/components/house.jsx |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/src/components/house.jsx b/src/components/house.jsx
index 1e04bb6..293604d 100644
--- a/src/components/house.jsx
+++ b/src/components/house.jsx
@@ -3,14 +3,16 @@
 import { extend } from '@react-three/fiber';
 import { Geometry, Base, Subtraction, Addition } from '@react-three/csg';
 import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry';
+import { DEBUG } from '../config/setting';
 extend({ TextGeometry });
 
 const House = (props) => {
   const {
     wallThickness = 2,
-    width = 1400,
-    length = 1200,
-    height = 400,
+    wallOpacity = .6,
+    width = DEBUG ? 14000 : 1400,
+    length = DEBUG ? 12000 : 1200,
+    height = DEBUG ? 4000 : 400,
     aside_width = 130,
     aside_length = 130,
     position = new THREE.Vector3(200, 0, 0),
@@ -45,7 +47,6 @@
   const texture = new THREE.TextureLoader().load(
     `/textures/wall_pic5.jpg`
   );
-  console.log('env', process.env.NODE_ENV);
 
   texture.wrapS = THREE.RepeatWrapping; // 姘村钩鏂瑰悜閲嶅
   texture.repeat.set(0.02, 0.02);
@@ -431,7 +432,7 @@
             { depth: wallThickness },
           ]}
         />
-        <meshPhongMaterial map={texture} metalness={1.0} reflectivity={1.5}></meshPhongMaterial>
+        <meshPhongMaterial map={texture} metalness={1.0} reflectivity={1.5} transparent={true} opacity={wallOpacity}></meshPhongMaterial>
       </mesh>
       {/* 鍚庨潰鐨勮矾 */}
       <mesh rotation={[Math.PI / 2, 0, 0]}>
@@ -452,7 +453,7 @@
             { depth: wallThickness },
           ]}
         />
-        <meshPhongMaterial map={texture} metalness={1.0} reflectivity={1.5}></meshPhongMaterial>
+        <meshPhongMaterial map={texture} metalness={1.0} reflectivity={1.5} transparent={true} opacity={wallOpacity}></meshPhongMaterial>
       </mesh>
       {/* 鍓嶉潰鐨勫澹佷笅闈㈢殑璺� */}
       <mesh rotation={[Math.PI / 2, 0, 0]}>
@@ -482,7 +483,10 @@
         receiveShadow
       >
         <extrudeGeometry args={[getBackWallShape(), { depth: wallThickness }]} />
-        <meshPhysicalMaterial map={texture} metalness={1.0} roughness={0.8}></meshPhysicalMaterial>
+        <meshPhysicalMaterial map={texture} metalness={1.0} roughness={0.8}
+          transparent={true}
+          opacity={wallOpacity}
+        ></meshPhysicalMaterial>
       </mesh>
       <mesh rotation={[Math.PI / 2, 0, 0]}>
         <LeftRoad></LeftRoad>
@@ -517,6 +521,8 @@
           color={'#0069c5'}
           metalness={1.0}
           roughness={0.8}
+          transparent={true}
+          opacity={wallOpacity}
         ></meshPhysicalMaterial>
       </mesh>
       {/* 椤堕儴绗簩灞� */}
@@ -530,6 +536,8 @@
           color={'#4895f6'}
           metalness={1.0}
           roughness={0.8}
+          transparent={true}
+          opacity={wallOpacity}
         ></meshPhysicalMaterial>
       </mesh>
       {/* 椤堕儴绗笁灞� */}
@@ -543,6 +551,8 @@
           map={roofTexture}
           metalness={1.0}
           roughness={0.8}
+          transparent={true}
+          opacity={wallOpacity}
         ></meshPhysicalMaterial>
       </mesh>
     </group>

--
Gitblit v1.9.1