Skip to content

Commit

Permalink
Merged ripple
Browse files Browse the repository at this point in the history
  • Loading branch information
samluescher committed Apr 20, 2013
2 parents 2ceaf13 + 8d89c57 commit 20fb8bd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/mainApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,7 @@ class mainApp : public ReliefClientBase{

ofxUICanvas *calibrationGUI, *layersGUI;
void guiEvent(ofxUIEventArgs &e);

ofxRipples rip;
};

27 changes: 25 additions & 2 deletions src/mainApp.mm
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,17 @@
coll->timelinePos = (year - EARTHQUAKE_START_YEAR) / float(EARTHQUAKE_END_YEAR - EARTHQUAKE_START_YEAR);
ofLog() << coll->title << " " << coll->timelinePos;
}

for (int i = 0; i < featureLayers.size(); i++) {
MapFeatureLayer *layer = featureLayers.at(i);
layer->visible = i == 0;
}

// ripple (from ofxFX)
rip.allocate(555,555);
ofImage ripBackground;
ripBackground.loadImage("maps/heightmap.mantle.png");
rip.setTexture(ripBackground.getTextureReference(),1);

#if (TARGET_OS_IPHONE)
EAGLView *view = ofxiPhoneGetGLView();
Expand Down Expand Up @@ -643,6 +649,15 @@

void mainApp::update()
{
// ripple (from ofxFX)
rip.begin();
ofFill();
ofSetColor(ofNoise( ofGetFrameNum() ) * 255 * 5, 255);
ofEllipse(mouseX,mouseY, 10,10);
rip.end();
rip.update();


fingerMovie.update();
realworldUnitToTerrainUnit = realworldUnitToGlUnit / (1 / terrainUnitToGlUnit);

Expand Down Expand Up @@ -872,6 +887,14 @@
glow.draw(0, 0);
ofDisableAlphaBlending();
*/

// ripple (from ofxFX)
ofSetColor(255,255);

rip.draw(0,0);
//ofDrawBitmapString("ofxRipples ( damping = " + ofToString(rip.damping) + " )", 15,15);



}

Expand Down Expand Up @@ -1764,7 +1787,7 @@

//--------------------------------------------------------------
void mainApp::mouseDragged(int x, int y, int button){

rip.damping = ofMap(y, 0, ofGetHeight(), 0.9, 1.0, true);
}

//--------------------------------------------------------------
Expand Down

0 comments on commit 20fb8bd

Please sign in to comment.