diff --git a/ArcBall.pde b/ArcBall.pde index b897e19..33cdea6 100644 --- a/ArcBall.pde +++ b/ArcBall.pde @@ -56,8 +56,6 @@ public class ArcBall implements PConstants{ currentRotation = new Quaternion(); startRotation = new Quaternion(); deltaRotation = new Quaternion(); - - } /** @@ -95,13 +93,15 @@ public class ArcBall implements PConstants{ * Update currentRotation with data from dragging */ public void update(){ -// if( dragging ) { - currentRotation = quaternion.mult(deltaRotation, startRotation); -// } else { -// Quaternion.mult(deltaRotation, currentRotation, currentRotation); -// deltaRotation = deltaRotation.power(0.8f); -// } + if( dragging ) { + currentRotation = quaternion.mult(deltaRotation, startRotation); + } else { + currentRotation = quaternion.mult(deltaRotation, currentRotation); + deltaRotation = deltaRotation.power(0.9f); + } + applyRotation(currentRotation); + } /** diff --git a/sketch3d.pde b/sketch3d.pde index 398d4cb..81f3264 100644 --- a/sketch3d.pde +++ b/sketch3d.pde @@ -368,7 +368,7 @@ void update() { } if ( rotatingNow ) { //arcBall.dragging( mouseX, mouseY ); - arcBall.dragging(secondaryHandScreen.x, secondaryHandScreen.y ); + arcBall.dragging(secondaryHandScreen.x, secondaryHandScreen.y ); } if ( moveDrawing && !drawingNow ) { moveNow.set( secondaryHand );