SketchPad

Some web space to sketch, doodle and make notes. Made using these tools. See more of my work here.

Daily Sketches

Sketch 2015-05-25

        void ofApp::setupAnim() {
    ofEnableSmoothing();
    
    for(int i = 0; i < width; i += 120) {
        for(int j = 0; j < height; j += 120) {
            shape.setupHollowSquare(20, 80);
            shape.setBlur(1);
            shape.setPosition(ofVec3f(i + 5, j + 5, 0));
            shape.rotateZ(ofRandom(360));
            shapes.push_back(shape);
        }
    }
    
    for(int i = 0; i < shapes.size(); i++) {
        shapeSystem.add(shapes.at(i));
    }
}

void ofApp::updateAnim(){
    for(int i = 0; i < shapes.size(); i++) {
        i % 2 == 0 ?
            shapes.at(i).incrementRotateZ(12) :
            shapes.at(i).incrementRotateZ(-12);
    }
}

void ofApp::drawAnim() {
    ofBackground(0, 0, 0);

    ofEnableAlphaBlending();

    ofTranslate(-30, -30);
    for(int i = 0; i < shapes.size(); i++) {
        shapes.at(i).setColor(ofColor(ofColor::white, 64));
    }
    shapeSystem.draw();

    ofTranslate(10, 10);
    for(int i = 0; i < shapes.size(); i++) {
        shapes.at(i).setColor(ofColor(ofColor::white, 128));
    }
    shapeSystem.draw();

    ofTranslate(10, 10);
    for(int i = 0; i < shapes.size(); i++) {
        shapes.at(i).setColor(ofColor(ofColor::white, 192));
    }
    shapeSystem.draw();

    ofTranslate(10, 10);
    for(int i = 0; i < shapes.size(); i++) {
        shapes.at(i).setColor(ofColor(ofColor::white, 255));
    }
    shapeSystem.draw();

    ofDisableAlphaBlending();

    if(ofGetFrameNum() == 30) renderGif();
}
    

Fast sketches are meaningless.

Daily sketch