summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/src/chainImageSet.cpp12
-rw-r--r--gui/src/ofApp.cpp20
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<sets.size();i++){
sets[i].drawOutput();
}
@@ -230,7 +232,7 @@ void ofApp::keyPressed(ofKeyEventArgs &args){
sets[selected_set].keyPressed(args);
- if(args.key == '-'){
+ if(args.key == '\''){
selected_set-=1;
if (selected_set<0) selected_set=sets.size()-1;
}
@@ -238,6 +240,22 @@ void ofApp::keyPressed(ofKeyEventArgs &args){
selected_set+=1;
if (selected_set==sets.size()) selected_set=0;
}
+
+ if(args.key == '-'){
+ sets[0].decayFactor=1.0f+(1.0f-sets[0].decayFactor);
+ sets[1].decayFactor=sets[0].decayFactor;
+ printf("Decayfactor: %f \n",sets[0].decayFactor);
+ }
+
+ if(args.key >='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){