diff --git a/open3mod/OrbitCameraController.cs b/open3mod/OrbitCameraController.cs index f083acc..2e500b5 100644 --- a/open3mod/OrbitCameraController.cs +++ b/open3mod/OrbitCameraController.cs @@ -96,7 +96,11 @@ public void MouseMove(int x, int y) if (x != 0) { - _view *= Matrix4.CreateFromAxisAngle(_up, (float)(x * RotationSpeed * Math.PI / 180.0)); + // Free Orbit + //_view *= Matrix4.CreateFromAxisAngle(_up, (float)(x * RotationSpeed * Math.PI / 180.0)); + + // Constrained Orbit: Keep Model Upright when Rotating + _view *= Matrix4.CreateFromAxisAngle(Matrix4.Invert(_view).Column1.Xyz, (float)(x * RotationSpeed * Math.PI / 180.0)); } if (y != 0)