From 27468e4bfd9aa3c1611d18270dbc6d33f3f00127 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 02 四月 2024 13:52:19 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 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 26f3309..96c3424 100644
--- a/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
+++ b/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
@@ -7,9 +7,10 @@
import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass';
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass';
import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader';
+import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader'
+import * as Utils from '../../utils'
-
-const help = false;
+const help = true;
export default class ShelfThree {
@@ -183,7 +184,30 @@
}
generateMesh = (fn) => {
- fn(this.addObject);
+ // fn(this.addObject);
+ const loader = new FBXLoader();
+ loader.load('model/001-1.fbx', (mesh) => {
+ console.log(mesh);
+ mesh.position.set(0, 10, 0);
+ mesh.scale.set(5, 5, 5);
+ mesh.rotation.x = Utils.rotationParseNum(270);
+ mesh.traverse(function (child) {
+ if (child.isMesh) {
+ child.castShadow = true;
+ child.receiveShadow = true;
+ }
+ });
+ this.addObject(mesh);
+ })
+ }
+
+ setNewSelectedMesh = (objName) => {
+ for (const mesh of this.objects) {
+ if (mesh.name === objName) {
+ this.outlinePass.selectedObjects = [mesh];
+ break;
+ }
+ }
}
destroy = () => {
--
Gitblit v1.9.1