diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-01-10 21:53:56 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-01-10 21:53:56 +0000 |
| commit | 9f1fdb2fa8fa09dbd990b33379db98762f3856ce (patch) | |
| tree | 4d76bf3c3f51616d07b79411bc7363382d6719a1 /gui/src | |
| parent | 4c9570bdf49ec3a6517e5be60fc960d7d9cdbed0 (diff) | |
use ofxEase for rotation
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/chainImage.cpp | 16 | ||||
| -rw-r--r-- | gui/src/chainImage.h | 5 | ||||
| -rw-r--r-- | gui/src/chainImageSet.cpp | 5 |
3 files changed, 19 insertions, 7 deletions
diff --git a/gui/src/chainImage.cpp b/gui/src/chainImage.cpp index 1fbcc73..d362b0c 100644 --- a/gui/src/chainImage.cpp +++ b/gui/src/chainImage.cpp @@ -237,14 +237,24 @@ float chainImage::getRotation(){ } ofxSweepLine crashes - */ + float transitionInterpolated=pow(transition,ROTATION_EASE_POWER); - //printf("rotation: %f at point %f\n",transitionInterpolated,transition); - + printf("rotation: %f of %f at point %f (%f)\n", + transitionInterpolated*link->getLinkRot(), + link->getLinkRot(), + transition, + transitionInterpolated + ); + + return getLinkRot()+(transitionInterpolated*link->getLinkRot()); + */ + + return ofxeasing::map_clamp(transition, 0, 1, getLinkRot(), getLinkRot()+link->getLinkRot(), ofxeasing::cubic::easeInOut); + }; ofPoint chainImage::getLinkPos(){ diff --git a/gui/src/chainImage.h b/gui/src/chainImage.h index 9bfc70c..034d0a4 100644 --- a/gui/src/chainImage.h +++ b/gui/src/chainImage.h @@ -2,6 +2,7 @@ #include "ofMain.h" #include "ofxJSON.h" +#include "ofxEasing.h" #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) > (b) ? (a) : (b)) @@ -9,8 +10,8 @@ #define THUMB_BORDER_RATIO 0.8 #define THUMB_SIZE 160 #define DEFAULT_FADEIN 1.0 -#define BEZIER_OUT 0.5 -#define BEZIER_IN 0.5 +#define BEZIER_OUT 0.25 +#define BEZIER_IN 0.25 #define ROTATION_BEZIER_FRACTION 0.0 #define ROTATION_EASE_POWER 4.0 diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp index 569ab0e..d3d363f 100644 --- a/gui/src/chainImageSet.cpp +++ b/gui/src/chainImageSet.cpp @@ -40,6 +40,7 @@ void chainImageSet::drawOutput(){ glScalef(ZOOM_FUDGE_FACTOR,ZOOM_FUDGE_FACTOR,ZOOM_FUDGE_FACTOR); //easy way to limit camera cutoff //printf("drawing rotation %f for transition %f\n",(*currentImage)->getRotation(),(*currentImage)->transition); + float rot=(*currentImage)->getRotation(); gluLookAt( (*currentImage)->getTransform().x, (*currentImage)->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint), @@ -47,8 +48,8 @@ void chainImageSet::drawOutput(){ (*currentImage)->getTransform().x, (*currentImage)->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint), 0, - sin(-(*currentImage)->getRotation()*(PI/180)), - cos(-(*currentImage)->getRotation()*(PI/180)), + sin(-rot*(PI/180)), + cos(-rot*(PI/180)), 0); |
