From 6361fc600aefdec174c88213a9e84e76f2982019 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 19 Sep 2017 10:56:50 +0100 Subject: several fies --- gui/src/chainImageSet.cpp | 12 +++++++++--- gui/src/ofApp.cpp | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp index 7952d7c..963333a 100644 --- a/gui/src/chainImageSet.cpp +++ b/gui/src/chainImageSet.cpp @@ -6,7 +6,7 @@ void chainImageSet::drawOutput(){ float camera_throw= (float)outputSize.y/(float)outputSize.x; //the ratio of z distance to x width - camera_throw*=fitFactor; //fudge factor to allow tweening + camera_throw*=fitFactor; //fudge factor to allow tweening, //printf("Drawing chain: %i images\n",images.size()); @@ -19,6 +19,7 @@ void chainImageSet::drawOutput(){ */ glMatrixMode ( GL_MODELVIEW ); glLoadIdentity ( ); + /* is not what we want glOrtho( 0, (*currentImage)->getTransform().x*2, @@ -27,6 +28,9 @@ void chainImageSet::drawOutput(){ -100, (*currentImage)->getTransform().x*4 ); + */ + glScalef(8,8,8); //easy way to avoid camera cutoff + gluLookAt( (*currentImage)->getTransform().x, (*currentImage)->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint), (*currentImage)->getWidth()*camera_throw*(*currentImage)->getScale(), @@ -37,6 +41,8 @@ void chainImageSet::drawOutput(){ cos(-(*currentImage)->getRotation()*(PI/180)), 0); + + (*currentImage)->drawChain(DEFAULT_FADEIN,additive,intensity); @@ -461,7 +467,7 @@ void chainImageSet::updateOutput(){ ofLogNotice() << "Switched image forward to " << (*currentImage)->filename; - (*currentImage)->start(); + (*currentImage)->start(false); (*currentImage)->updateOutput(decayFactor); break; @@ -476,7 +482,7 @@ void chainImageSet::updateOutput(){ currentImage--; - (*currentImage)->start(); + (*currentImage)->start(true); ofLogNotice() << "Switched images backward to " << (*currentImage)->filename; (*currentImage)->updateOutput(decayFactor); break; diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 3cc4878..9f29388 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -74,6 +74,8 @@ void ofApp::draw(){ void ofApp::drawOutput(ofEventArgs & args){ ofBackground(0,0,0); + + for (int i=0;i='1' && args.key <= '9'){ + sets[0].decayFactor = 1.0f + ( + pow(4.0f,-((args.key-'1')+1.0f)) + * (sets[0].decayFactor<1.0f?-1:1) + ); + sets[1].decayFactor=sets[0].decayFactor; + printf("Keydiff: %f Decayfactor: %f \n",((args.key-'1')+1.0f),sets[0].decayFactor); + } + } void ofApp::outputKeyPressed(ofKeyEventArgs &args){ -- cgit v1.2.3