From 5f93fa914f234dd762b0d08207e4ebc0e33943a3 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Mon, 24 Apr 2023 17:47:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B93d=E5=9C=B0=E5=9B=BE=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/park/center.vue | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/view/park/center.vue b/src/view/park/center.vue index 470e2d6..fa0aedc 100644 --- a/src/view/park/center.vue +++ b/src/view/park/center.vue @@ -327,6 +327,18 @@ import Point from './Point' var controls = new MapControls(camera, map.value) controls.maxPolarAngle=Math.PI/2 controls.minPolarAngle=0 + controls.dispatchEvent=e=>{ + names.forEach(v=>{ + v.rotation.x=camera.rotation.x + v.rotation.y=camera.rotation.y + v.rotation.z=camera.rotation.z + }) + labels.forEach(v=>{ + v.rotation.x=camera.rotation.x + v.rotation.y=camera.rotation.y + v.rotation.z=camera.rotation.z + }) + } } function addMap(){ var shape = new THREE.Shape() @@ -660,17 +672,6 @@ import Point from './Point' renderer.render(scene, camera); modalRenderer.render(scene, camera); requestAnimationFrame(render) - - names.forEach(v=>{ - v.rotation.x=camera.rotation.x - v.rotation.y=camera.rotation.y - v.rotation.z=camera.rotation.z - }) - labels.forEach(v=>{ - v.rotation.x=camera.rotation.x - v.rotation.y=camera.rotation.y - v.rotation.z=camera.rotation.z - }) } function move({clientX, clientY}){ raycaster.setFromCamera(