From 21d88a01807b3a27787bdbbcd657dbbffaa58172 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 08 四月 2024 15:51:01 +0800 Subject: [PATCH] Merge branch 'Four-Way-Rack' of http://47.97.1.152:5880/r/zy-asrs-master into Four-Way-Rack --- zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 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 010d3ed..019533c 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 = true; +const help = false; export default class ShelfThree { @@ -64,9 +64,6 @@ initScene = () => { const scene = new THREE.Scene(); - // scene.background = new THREE.Color(0xf0f0f0); - // scene.background = new THREE.Color(0x333333); - // scene.background = new THREE.Color(0xf8f8f8); scene.background = new THREE.Color(0x7a7a7a); scene.fog = new THREE.Fog(scene.background, 1, 5000); @@ -121,14 +118,14 @@ initControls = () => { const controls = new OrbitControls(this.camera, this.renderer.domElement); // controls.enableRotate = false; // 绂佺敤鏁翠綋鏃嬭浆鍔熻兘 - controls.enablePan = true; // 鍏佽骞崇Щ + controls.enablePan = false; // 鍏佽骞崇Щ 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; // 鑷姩鏃嬭浆 @@ -203,6 +200,12 @@ } } + rePerspective = (maxHeight) => { + const cameraPosScale = 0.7; + this.camera.position.set(-maxHeight * cameraPosScale, maxHeight * cameraPosScale, maxHeight * cameraPosScale); + this.controls.target = new THREE.Vector3(0, maxHeight * 0.53, 0); + } + destroy = () => { cancelAnimationFrame(this.animationFrame); window.removeEventListener('resize', this.resizeHandler); -- Gitblit v1.9.1