diff options
| author | Tim Redfern <tim@getdrop.com> | 2017-12-14 20:33:31 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2017-12-14 20:33:31 +0000 |
| commit | 75094cedeb1910d8a7cdb86ac56617af25f21a54 (patch) | |
| tree | 91fcce44b20d1643a97cd1d3d67179fa5a869018 | |
| parent | b81a1e4b77ad82315b84dd5eb1a76d80a544bcdd (diff) | |
correct path drawing
| -rw-r--r-- | gui/src/chainImage.cpp | 5 | ||||
| -rw-r--r-- | gui/src/chainImage.h | 4 | ||||
| -rw-r--r-- | gui/src/chainImageSet.cpp | 26 |
3 files changed, 33 insertions, 2 deletions
diff --git a/gui/src/chainImage.cpp b/gui/src/chainImage.cpp index 1f130ae..5a24c7b 100644 --- a/gui/src/chainImage.cpp +++ b/gui/src/chainImage.cpp @@ -81,6 +81,11 @@ void chainImage::gpu_drawImage(){ */ } +//rotation could be a lot smoother +//atm we only do horizontal rotation splines +//movement is a bit jerky +//could it be possible to visualise the path? + void chainImage::updateRotationTimeline(){ rotationTimeline.clear(); diff --git a/gui/src/chainImage.h b/gui/src/chainImage.h index 1dbb808..1ac234c 100644 --- a/gui/src/chainImage.h +++ b/gui/src/chainImage.h @@ -6,8 +6,8 @@ #define THUMB_BORDER_RATIO 0.8 #define THUMB_SIZE 160 #define DEFAULT_FADEIN 1.0 -#define BEZIER_OUT 0.25 -#define BEZIER_IN 0.25 +#define BEZIER_OUT 0.125 +#define BEZIER_IN 0.125 #define ROTATION_BEZIER_FRACTION 0.1 #define SWITCH_NONE 0 diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp index 751b1ba..8f73013 100644 --- a/gui/src/chainImageSet.cpp +++ b/gui/src/chainImageSet.cpp @@ -195,6 +195,32 @@ void chainImageSet::drawGui(int x,int y,bool is_selected){ } + glPushMatrix(); + + ofSetColor(255,0,255); + + glTranslatef(t_xoffs+borderwidth+thumbx,borderwidth+thumby,0); + //this gets us to the middle of the image + + ofDrawRectangle(-5,-5,10,10); + + ofSetLineWidth(5); + + float pathscale=thumbscale/(((*ii)->linked)->linkScale); + + //draw the path here + glScalef(pathscale,pathscale,pathscale); + + //path starts at the linkpos and goes to the link's linkpos + //could it equally go from this point? + ((*ii)->linked)->updateOutput(decayFactor); + ofPoint start=((*ii)->linked)->path.getPointAtLength(0.0f); + glTranslatef(-start.x,-start.y,0); + ((*ii)->linked)->path.draw(); + + ofSetLineWidth(1); + + glPopMatrix(); t_xoffs+=(*ii)->thumbnail.getWidth()+(borderwidth*2); |
