Sketch 2015-05-28
void ofApp::setupAnim() {
ofEnableSmoothing();
maskOpacity = 0;
}
void ofApp::drawAnim() {
ofEnableAlphaBlending();
ofSetColor(0, 0, 0, 30);
ofRect(0, 0, width, height);
ofSetColor(ofColor::red);
for(int i = 0; i < 8; i++) {
for(int j = 0; j < 10; j++) {
x = ofRandom(0, width);
y = ofRandom(-40, -20);
ofLine(x, y, x, y + halfWidth + 50);
}
rotateScreen(45);
}
if(ofGetFrameNum() > 12) {
ofSetColor(ofColor(ofColor::white, maskOpacity));
ofRect(0, 0, width, height);
maskOpacity += 20;
}
ofDisableAlphaBlending();
if(maskOpacity > 255) {
renderGif();
}
}
void ofApp::rotateScreen(float degrees) {
ofTranslate(halfWidth, halfHeight, 0);
ofRotate(degrees);
ofTranslate(-halfWidth, -halfHeight, 0);
}
Constraints.