#include "ofApp.h" #include "glew.h" //-------------------------------------------------------------- void ofApp::setup(){ std::string filename; float speedscale=0.999; float overlapscale=0.3; float transitionscale=0.6; if (arguments.size()>1){ filename=arguments.at(1); } else filename="jukebox_1.JPG"; //"tile-grid-png-6.png"; // //hubble_Orion_nebula.tif"; // float t=ofGetElapsedTimef(); if (i1.load(filename)){ ofLogNotice() << "Loaded : "<start(); currentFrame=0; } //-------------------------------------------------------------- void ofApp::update(){ std::stringstream strm; strm << "fps: " << ofGetFrameRate(); ofSetWindowTitle(strm.str()); if (currentImage->update()){ //if returns true, switch images currentImage=currentImage->link; currentImage->start(); ofLogNotice() << "Switched images"; currentFrame=0; //viewpoint.resetTransform(); //or we get a glitch for no apparent reason, or not currentImage->update(); } //viewpoint misbehaves the first frame it is moved. } //-------------------------------------------------------------- void ofApp::draw(){ //viewpoint.begin(); float camera_throw= 0.6667; //the ratio of z distance to x width glMatrixMode ( GL_MODELVIEW ); glLoadIdentity ( ); gluLookAt( currentImage->getTransform().x, currentImage->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint), currentImage->getWidth()*camera_throw*currentImage->getScale() , currentImage->getTransform().x, currentImage->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint), 0, 0,1,0); //if (currentFrame>0) { ofBackground(0,0,0); currentImage->drawChain(); //} //else { //ofSetColor(255,255,255); //ofDrawRectangle(-100,-100,200,200); //currentImage->link->drawChain(); //attempted hack //} /* printf(">>Draw %i %f complete %f,%f at %f from %f,%f,%f\n", currentFrame, currentImage->transition, currentImage->linkPos.x, currentImage->linkPos.y, currentImage->getScale(), currentImage->getTransform().x, currentImage->getTransform().y, currentImage->getWidth()*camera_throw*currentImage->getScale() ); */ /* viewpoint.setPosition(currentImage->getTransform().x, currentImage->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint), currentImage->getWidth()*camera_throw*currentImage->getScale()); */ //ofCamera DOES NOT WORK, it produces spurious coordinates the first frame it is moved /* ofLogNotice() << "Camera at: "<