Autumn

Notebook by Doug Blank

In [6]:
void setup() {
    size(200, 100);
}

void draw() {
    drawLeaf(50, 50, 20, 20);
    drawLeaf(120, 50, 70, 70);
}

void drawLeaf(float x, float y, float w, float h) {
    fill(255);
    float p1x = x - w * 0.6;
    float p1y = y;
    float p2x = x + w * 0.4;
    float p2y = y - h * 0.7;
    float p3x = x;
    float p3y = y + h * 0.3;
    triangle(p1x, p1y, p2x, p2y, p3x, p3y);
    fill(0, 255, 0);
    ellipse(x, y, 5, 5);
}
Sketch #5:

Sketch #5 state: Loading...