From 75ce35a2d6cd026a091805a34c6b7ce8a38f943a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 07 四月 2024 14:20:49 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js | 37 ++++---------------------------------
1 files changed, 4 insertions(+), 33 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 9f6818d..010d3ed 100644
--- a/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
+++ b/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
@@ -10,7 +10,7 @@
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader'
import * as Utils from '../../utils'
-const help = false;
+const help = true;
export default class ShelfThree {
@@ -121,14 +121,14 @@
initControls = () => {
const controls = new OrbitControls(this.camera, this.renderer.domElement);
// controls.enableRotate = false; // 绂佺敤鏁翠綋鏃嬭浆鍔熻兘
- controls.enablePan = false; // 鍏佽骞崇Щ
+ controls.enablePan = true; // 鍏佽骞崇Щ
controls.enableDamping = true; // 寮�鍚樆灏�
controls.dampingFactor = 0.08; // 闃诲凹鍥犲瓙
controls.enableZoom = true; // 鍏佽缂╂斁
// controls.minDistance = 1; // 鏈�灏忕缉鏀捐窛绂�
// controls.maxDistance = 30; // 鏈�澶х缉鏀捐窛绂�
controls.minPolarAngle = 0; // 鏈�灏忎刊浠拌搴︼紙鍚戜笅鐪嬶級
- controls.minPolarAngle = Math.PI / 2.1;
+ // controls.minPolarAngle = Math.PI / 2.1;
controls.maxPolarAngle = Math.PI / 2.1; // 鏈�澶т刊浠拌搴︼紙鍚戜笂鐪嬶級
controls.rotateSpeed = 0.6; // 瑙嗚绉诲姩閫熷害鍑忔參
controls.autoRotate = true; // 鑷姩鏃嬭浆
@@ -190,37 +190,8 @@
}
generateMesh = (fn) => {
- // fn(this.addObject);
const loader = new FBXLoader();
- 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.traverse(function (child) {
- if (child.isMesh) {
- if (child.name === '涓嶈鍒�') {
- // child.visible = false;
- child.material.color.set(0xE8B67E);
- }
- if (child.name === '璐ф灦') {
- // child.visible = false;
- child.material.color.set(0x4680BF);
- }
- if (child.name === '鎵樼洏') {
- // child.visible = false;
- child.material.color.set(0xBEBEBE);
- }
- child.name = '1-1-1'
- child.castShadow = true;
- child.receiveShadow = true;
- }
- });
- this.addObject(mesh);
- resolve();
- })
- })
- return promise;
+ fn(loader, this.addObject);
}
setNewSelectedMesh = (objName) => {
--
Gitblit v1.9.1