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(