From 93ebc2f7a4b7879b19269f96c29f13de9cf93c84 Mon Sep 17 00:00:00 2001 From: hejiayao <782841784@qq.com> Date: Fri, 20 Mar 2026 13:34:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/RawImageModelViewer.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/RawImageModelViewer.cs b/Assets/Scripts/RawImageModelViewer.cs index e6217cc..fa0093d 100644 --- a/Assets/Scripts/RawImageModelViewer.cs +++ b/Assets/Scripts/RawImageModelViewer.cs @@ -147,16 +147,16 @@ public class RawImageModelViewer : MonoBehaviour Bounds bounds = CalculateBounds(displayedModel); modelCenter = bounds.center; - float objectSize = Mathf.Max(modelCenter.x, modelCenter.y, modelCenter.z); + /*float objectSize = Mathf.Max(modelCenter.x, modelCenter.y, modelCenter.z); targetDistance = objectSize * 1.5f; targetDistance = Mathf.Clamp(childTargetDistance, minZoomDistance, maxZoomDistance); currentDistance = targetDistance; - targetPositionOffset = Vector3.zero; - Vector3 toCamera = (renderCamera.transform.position - modelCenter).normalized; targetRotation.x = Mathf.Atan2(toCamera.x, toCamera.z) * Mathf.Rad2Deg; - targetRotation.y = Mathf.Asin(toCamera.y) * Mathf.Rad2Deg; + targetRotation.y = Mathf.Asin(toCamera.y) * Mathf.Rad2Deg;*/ + + ResetView(); } private void HandleInput() @@ -301,8 +301,9 @@ public class RawImageModelViewer : MonoBehaviour /// public void ResetView() { - targetRotation = modelInitialRotation; - targetDistance = defaultZoomDistance; + //targetRotation = modelInitialRotation; + targetRotation = new Vector3(20,130,0); + targetDistance = 1.0f; targetPositionOffset = Vector3.zero; }