diff options
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(); |
