diff options
| author | Tim Redfern <tim@getdrop.com> | 2017-08-31 12:43:03 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2017-08-31 12:43:03 +0100 |
| commit | 809dbfb4e437c5c991d8ed4d9b8c097ac95abda9 (patch) | |
| tree | 82e08c7cd6f61424ca65cd0174c62297b1daaa2a /gui/src/chainImage.cpp | |
| parent | 742e27767fd4208afe99ac42f243b88eef0ed7b3 (diff) | |
prototype DMX control
Diffstat (limited to 'gui/src/chainImage.cpp')
| -rw-r--r-- | gui/src/chainImage.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gui/src/chainImage.cpp b/gui/src/chainImage.cpp index 032b54c..83363db 100644 --- a/gui/src/chainImage.cpp +++ b/gui/src/chainImage.cpp @@ -77,6 +77,16 @@ float chainImage::getScale(){ return scale; } +float chainImage::getRotation(){ + //this is the camera rotation + //at the beginning of the transition + //this should rotate to match linkRot + //at the end, it should match link->linkRot + //when we switch image, link->linkRot becomes linkRot + //linkRot is no longer seen + + return linkRot+(transition*link->linkRot); +}; void chainImage::makeThumbnail(){ thumbnail=(const ofImage)*this; //copy the ofImage itself @@ -110,6 +120,8 @@ void chainImage::drawChain(float fadeIn){ glTranslatef(linkPos.x,linkPos.y,0); + glRotatef(linkRot,0,0,1); + glScalef(linkScale,linkScale,linkScale); ofEnableAlphaBlending(); @@ -146,6 +158,8 @@ bool chainImage::fromJson(Json::Value json){ void chainImageSet::drawOutput(){ + //movment and rotation are working on their own but not together. + float camera_throw= (float)outputSize.y/(float)outputSize.x; //the ratio of z distance to x width if (images.size()){ @@ -158,7 +172,10 @@ void chainImageSet::drawOutput(){ currentImage->getTransform().x, currentImage->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint), 0, - 0,1,0); + sin(-currentImage->getRotation()*(PI/180)), + cos(-currentImage->getRotation()*(PI/180)), + 0); + currentImage->drawChain(); |
