fstl-app / fstl

A fast STL file viewer
463 stars 106 forks source link

Slow mouse rotation compared to previous release #119

Open tpikonen opened 5 months ago

tpikonen commented 5 months ago

The 'arc-ball' mouse control PR (#99) had the side effect of slowing down the mouse rotation by a large factor. I liked the fast rotation behavior of the previous release (0.10.0), so I fixed it by this trivial patch:

diff --git a/src/canvas.cpp b/src/canvas.cpp
index ff9f3ec..7f061e0 100644
--- a/src/canvas.cpp
+++ b/src/canvas.cpp
@@ -441,7 +441,7 @@ void Canvas::calcArcballTransform(QPointF p1, QPointF p2) {
     double angle = acos(std::min(1.0f,QVector3D::dotProduct(v1, v2))) * 180.0 / M_PI;

     // apply transform
-    currentTransform.rotate(angle,v1xv2Obj);
+    currentTransform.rotate(5.0*angle,v1xv2Obj);
 }

 void Canvas::mouseMoveEvent(QMouseEvent* event)

The factor 5.0 used here is not quite as fast as the previous version, but IMO better than the current master.

Should this change made (I can make a PR out of this), or should the acceleration factor be made configurable? Maybe not since fstl is currently nicely configuration-free.

DeveloperPaul123 commented 4 months ago

Could you post a video of the difference? I don't have a lot of context for this.

tpikonen commented 4 months ago

I don't think a video would help much with explaining this. It's just that the ratio of pointer movement to object rotation is a lot smaller in current master than in the previous release.

This could be seen a regression by someone (like me), but is also largely a matter of opinion.

DeveloperPaul123 commented 4 months ago

Right. Given that's the case, I think having it available as a preference parameter would be a good compromise.