Sketch 2015-05-13
void ofApp::setupAnim() {
numShapes = 4;
spacing = width / numShapes; //20
offset = spacing * 0.5; //10
for(int x = 0; x < numShapes; x++) {
for(int y = 0; y < numShapes; y++) {
for(int size = spacing - 2; size > 0; size-=4) {
ofxShape shape;
shape.setupHollowSquare(1, size);
shape.positionX(x * spacing + offset);
shape.positionY(y * spacing + offset);
shape.positionZ(100);
shapes.push_back(shape);
}
}
}
for(int i = 0; i < shapes.size(); i++) {
system.add(shapes.at(i));
}
}
void ofApp::updateAnim(){
for(int i = 0; i < shapes.size(); i++) {
if(i % 2 == 0) {
shapes.at(i).incrementRotateZ(1);
} else {
shapes.at(i).incrementRotateZ(-1);
}
}
}
void ofApp::drawAnim() {
ofBackground(0, 0, 0);
system.draw();
if(ofGetFrameNum() == 90) {
renderGif();
}
}
Looking for simple interactions which work against the pixel grid