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; }