Skip to content

Commit

Permalink
Added back rotation by arcBall
Browse files Browse the repository at this point in the history
Needs some fixing. Little springy when you let go.
  • Loading branch information
kellyegan committed Oct 14, 2014
1 parent 0d221d1 commit 6bd29e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions ArcBall.pde
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public class ArcBall implements PConstants{
currentRotation = new Quaternion();
startRotation = new Quaternion();
deltaRotation = new Quaternion();


}

/**
Expand Down Expand Up @@ -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);

}

/**
Expand Down
2 changes: 1 addition & 1 deletion sketch3d.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 6bd29e4

Please sign in to comment.