From b8f7103813f1fa7733fd255ba3dba3983f7b5c19 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 26 May 2021 12:13:53 -0700 Subject: [PATCH] Keep the rotation as a proportion of the width --- .../PartPreviewWindow/View3D/TrackballTumbleWidgetExtended.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MatterControlLib/PartPreviewWindow/View3D/TrackballTumbleWidgetExtended.cs b/MatterControlLib/PartPreviewWindow/View3D/TrackballTumbleWidgetExtended.cs index e854e3f25..3bee707ff 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/TrackballTumbleWidgetExtended.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/TrackballTumbleWidgetExtended.cs @@ -71,6 +71,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (TurntableEnabled) { var delta = mousePosition - rotationStartPosition; + // scale it to device units + delta *= 300 / this.Width; var zRotation = Matrix4X4.CreateFromAxisAngle(Vector3.UnitZ.Transform(world.RotationMatrix), delta.X * MathHelper.Tau / 360.0); var screenXRotation = Matrix4X4.CreateFromAxisAngle(Vector3.UnitX, -delta.Y * MathHelper.Tau / 360.0); activeRotationQuaternion = new Quaternion(zRotation * screenXRotation);