From 6e0667f14814a408e4d1dde6e93e77a408684efe Mon Sep 17 00:00:00 2001 From: 5nxtnxtnxt <5nxtnxtnxt@gmail.com> Date: Fri, 8 Dec 2023 00:33:52 +0900 Subject: [PATCH] =?UTF-8?q?fixed:=20camera=20zoom=EB=B2=94=EC=9C=84=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx | 4 ++-- front/src/components/SnowGlobeCanvas/models/Raycaster.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx b/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx index c55b3d6..89e7b6c 100644 --- a/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx +++ b/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx @@ -34,7 +34,7 @@ const SnowGlobeCanvas = React.memo( ( = ({ isClickedRef }) => { const zoomOutSpeed = 1 + delta * 2; if (isAnimating.current) { if (isClicked && !isZoom) { - const targetPosition = new THREE.Vector3(0, 3.5, 0); + const targetPosition = new THREE.Vector3(0, 2.5, 0); setView(true); - if (camera.position.distanceTo(targetPosition) > 6.5) { + if (camera.position.distanceTo(targetPosition) > 6) { camera.position.lerp(targetPosition, delta * 2); } else { isAnimating.current = false; @@ -35,7 +35,7 @@ const Raycaster: React.FC = ({ isClickedRef }) => { if (view) { setIsZoom(true); } else if (isZoom && !view) { - if (camera.position.distanceTo(new THREE.Vector3(0, 3.5, 0)) < 25) { + if (camera.position.distanceTo(new THREE.Vector3(0, 3.5, 0)) < 15) { camera.position.x = camera.position.x * zoomOutSpeed; camera.position.y = camera.position.y * zoomOutSpeed; camera.position.z = camera.position.z * zoomOutSpeed;