diff --git a/src/views/bim/bimHome/components/DeviceInfoDialog.vue b/src/views/bim/bimHome/components/DeviceInfoDialog.vue
new file mode 100644
index 0000000..0898c2c
--- /dev/null
+++ b/src/views/bim/bimHome/components/DeviceInfoDialog.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查看
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/bim/bimHome/components/DevicePie.vue b/src/views/bim/bimHome/components/DevicePie.vue
index 67499d0..1237b14 100644
--- a/src/views/bim/bimHome/components/DevicePie.vue
+++ b/src/views/bim/bimHome/components/DevicePie.vue
@@ -3,13 +3,17 @@
+
+
\ No newline at end of file
diff --git a/src/views/bim/bimHome/components/ThreeView.vue b/src/views/bim/bimHome/components/ThreeView.vue
index bbea9de..7dae170 100644
--- a/src/views/bim/bimHome/components/ThreeView.vue
+++ b/src/views/bim/bimHome/components/ThreeView.vue
@@ -108,20 +108,27 @@ const renderScene = () => {
};
const modelMouseClick = (event) => {
- mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
- mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
- raycaster.setFromCamera(mouse, camera);
- const intersects = raycaster.intersectObject(scene, true);
- if (intersects.length > 0) {
- console.log(intersects[0].object);
- outlineObj(intersects[0].object);
- }
+ if (event.button != 0) return;
+ const mouse = new THREE.Vector2();
+ mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
+ mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;
+ const raycaster = new THREE.Raycaster();
+ raycaster.setFromCamera(mouse, camera);
+ const intersected = raycaster.intersectObject(scene, true)
+ if (intersected.length) {
+ // 其他材质恢复原材质,待研究
+ intersected.forEach(obj => {
+
+ obj.object.material.transparent = true;
+ let color = new THREE.Color(obj.object.material.color);
+ console.log(123,color);
+ obj.object.material.color.set(color);
+ })
+ intersected[0].object.material.color.set(0x66ff00);
+ renderer.render(scene, camera);
+ }
};
-//高亮
-const outlineObj = (object) => {
- object.material.color.set(0x66ff00);
-}