Sketch 2015-06-16
void ofApp::setupAnim() {
numImages = 50;
imageSpacing = height / numImages;
image.setup("surface.png");
image.setTextureScale(0.4);
for(int i = 0; i < numImages; i++) {
image.setTextureOffsetX(ofRandom(500));
images.push_back(image);
imgColors.push_back(ofColor(255, ofRandom(150), ofRandom(50), ofRandom(100)));
}
offset = ofRandom(5000);
}
void ofApp::updateAnim(){
for(int i = 0; i < images.size(); i++) {
noise = ofNoise(i, ofGetFrameNum() * 0.06 + offset);
images.at(i).setPlaneHeight(noise * imageSpacing * 24);
images.at(i).incrementTextureOffsetX(i % 2 == 0 ? 0.06 : -0.06);
}
}
void ofApp::drawAnim() {
ofBackground(ofColor::black);
ofEnableAlphaBlending();
for(int i = 0; i < images.size(); i++) {
ofSetColor(imgColors.at(i));
images.at(i).draw(0, halfImageSpacing + imageSpacing * i);
}
ofDisableAlphaBlending();
if(ofGetFrameNum() == 100) {
renderGif();
}
}
Scalable textures, resizables planes...