From e5d499ae6a4e6b320f71c49987b76cc11f6bc1e4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 28 十月 2025 14:13:10 +0800
Subject: [PATCH] 首页问题
---
src/views/screen/components/screen-map-three/experience/world/enviroment.js | 47 ++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 42 insertions(+), 5 deletions(-)
diff --git a/src/views/screen/components/screen-map-three/experience/world/enviroment.js b/src/views/screen/components/screen-map-three/experience/world/enviroment.js
index 6af5286..b828455 100644
--- a/src/views/screen/components/screen-map-three/experience/world/enviroment.js
+++ b/src/views/screen/components/screen-map-three/experience/world/enviroment.js
@@ -13,11 +13,11 @@
this.textureLoader = new THREE.TextureLoader();
this.setSunLight();
- this.setRotateHola();
+ // this.setRotateHola();
this.setBackground();
- this.setCirclePoint();
+ // this.setCirclePoint();
- this.debuger();
+ // this.debuger();
}
setSunLight() {
// 骞宠鍏�1
@@ -117,13 +117,50 @@
}
}
+ destroy() {
+ this.disposeObject();
+ this.removeObject();
+ this.resetObject();
+ }
+
+ disposeObject() {
+ this.hola1.geometry.dispose();
+ this.hola1.material.dispose();
+ this.hola2.geometry.dispose();
+ this.hola2.material.dispose();
+ this.background.geometry.dispose();
+ this.background.material.dispose();
+ this.circle.geometry.dispose();
+ this.circle.material.dispose();
+ this.directionalLight1.dispose();
+ this.directionalLight2.dispose();
+ this.ambientLight.dispose();
+ }
+
+ removeObject() {
+ this.scene.remove(this.hola1);
+ this.scene.remove(this.hola2);
+ this.scene.remove(this.background);
+ this.scene.remove(this.circle);
+ }
+
+ resetObject() {
+ this.hola1 = null;
+ this.hola2 = null;
+ this.background = null;
+ this.circle = null;
+ this.directionalLight1 = null;
+ this.directionalLight2 = null;
+ this.ambientLight = null;
+ }
+
debuger() {
const gui = new GUI();
const folder1 = gui.addFolder('骞宠鍏�1');
const folder2 = gui.addFolder('骞宠鍏�2');
const folder3 = gui.addFolder('鐜鍏�');
-
+
folder1.add(this.directionalLight1.position, 'x').min(-200).max(200).step(1).name("x杞寸殑浣嶇疆");
folder1.add(this.directionalLight1.position, 'y').min(-200).max(200).step(1).name("y杞寸殑浣嶇疆");
folder1.add(this.directionalLight1.position, 'z').min(-200).max(200).step(1).name("z杞寸殑浣嶇疆");
@@ -137,4 +174,4 @@
folder3.add(this.ambientLight, 'intensity').min(0).max(1).step(0.1).name("寮哄害");
}
-}
\ No newline at end of file
+}
--
Gitblit v1.8.0