From 809dbfb4e437c5c991d8ed4d9b8c097ac95abda9 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 31 Aug 2017 12:43:03 +0100 Subject: prototype DMX control --- gui/src/chainImage.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gui/src/chainImage.cpp') 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(); -- cgit v1.2.3