Sketch 2015-05-03
void ofApp::setupAnim() {
ofEnableSmoothing();
ofEnableAntiAliasing();
shapeSystem.setup();
camera.setDistance(120);
for(int i = 0; i < 24; i++) {
GradientShape ring;
rings.push_back(ring);
}
for(int i = 0; i < rings.size(); i++) {
if(i % 3 == 0) color.set(255, 0, 0, 80);
if(i % 3 == 1) color.set(0, 255, 0, 80);
if(i % 3 == 2) color.set(0, 0, 255, 80);
rings.at(i).setupHollowRing(60, 3, i * 3); //Resolution, thickness, diameter
rings.at(i).setColor(color);
rings.at(i).setBlur(3);
shapeSystem.add(rings.at(i));
}
}
void ofApp::updateAnim(){
float current = sin(ofGetFrameNum() * 0.16);
endpoint = ofMap(current, -1, 1, 1257, 1263);
rotation = ofMap(current, -1, 1, 0, 360);
for(int i = 0; i < rings.size(); i++) {
if(i % 6 == 0) rings.at(i).rotateX(rotation);
if(i % 6 == 1) rings.at(i).rotateY(rotation);
if(i % 6 == 2) rings.at(i).rotateZ(rotation);
if(i % 6 == 3) rings.at(i).rotateX(-rotation);
if(i % 6 == 4) rings.at(i).rotateY(-rotation);
if(i % 6 == 5) rings.at(i).rotateZ(-rotation);
rings.at(i).setArcEndpoints(0, endpoint);
}
shapeSystem.update();
if(ofGetFrameNum() == 0) {
firstEndpoint = endpoint;
lastEndpoint = endpoint;
}
}
void ofApp::drawAnim() {
ofBackground(0, 0, 0);
camera.begin();
shapeSystem.draw();
camera.end();
if(endpoint > firstEndpoint && lastEndpoint < firstEndpoint) {
renderGif();
}
lastEndpoint = endpoint;
}
Like yesterday, but now going way past 2π radians (closing the ring shapes hundreds of times, which increases the alpha and generates 'star' artifacts based on segment repetition patterns over time)