diff --git a/ArcBall.pde b/ArcBall.pde index 33cdea6..ba7372b 100644 --- a/ArcBall.pde +++ b/ArcBall.pde @@ -86,8 +86,6 @@ public class ArcBall implements PConstants{ public void dragEnd() { dragging = false; } - - /** * Update currentRotation with data from dragging @@ -95,13 +93,17 @@ public class ArcBall implements PConstants{ public void update(){ if( dragging ) { currentRotation = quaternion.mult(deltaRotation, startRotation); + + if(frameCount % 3 == 0) { + startRotation.set(currentRotation); + deltaRotation.setToIdentity(); + startPoint.set(endPoint); + } } else { currentRotation = quaternion.mult(deltaRotation, currentRotation); - deltaRotation = deltaRotation.power(0.9f); + deltaRotation = deltaRotation.power(0.999f); } - - applyRotation(currentRotation); - + applyRotation(currentRotation); } /** diff --git a/sketch3d.pde b/sketch3d.pde index 81f3264..b0c006c 100644 --- a/sketch3d.pde +++ b/sketch3d.pde @@ -406,7 +406,7 @@ void mousePressed() { } void mouseDragged() { - arcBall.dragging(mouseX, mouseY); + //arcBall.dragging(mouseX, mouseY); } void mouseReleased() {