From 047d6181a5f51711521c5e38f081d6e8760e22d6 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 07 四月 2024 10:45:34 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js b/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
index 3feb447..4ded7ab 100644
--- a/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
+++ b/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
@@ -190,20 +190,34 @@
     generateMesh = (fn) => {
         // fn(this.addObject);
         const loader = new FBXLoader();
-        loader.load('model/001-5.fbx', (mesh) => {
-            mesh.position.set(0, 10, 0);
-            mesh.scale.set(5, 5, 5);
-            mesh.name = '0100101';
-            // mesh.rotation.x = Utils.rotationParseNum(270);
-            mesh.traverse(function (child) {
-                if (child.isMesh) {
-                    child.name = '0100101';
-                    child.castShadow = true;
-                    child.receiveShadow = true;
-                }
-            });
-            this.addObject(mesh);
+        const promise = new Promise((resolve) => {
+            loader.load('model/04.fbx', (mesh) => {
+                mesh.position.set(0, 10, 0);
+                mesh.scale.set(5, 5, 5);
+                mesh.name = '1-1-1';
+                // mesh.rotation.x = Utils.rotationParseNum(270);
+                mesh.traverse(function (child) {
+                    if (child.isMesh) {
+
+                        if (child.name === '涓嶈鍒�') {
+                            // child.visible = false;
+                            console.log(material);
+                        }
+                        if (child.name === '璐ф灦') {
+                            child.material.color.set(0x4680BF);
+                        }
+                        // if (child.name === '鎵樼洏') {
+                        //     child.material.color.set(0xBEBEBE);
+                        // }
+                        child.castShadow = true;
+                        child.receiveShadow = true;
+                    }
+                });
+                this.addObject(mesh);
+                resolve();
+            })
         })
+        return promise;
     }
 
     setNewSelectedMesh = (objName) => {

--
Gitblit v1.9.1