• Code:

float theta,index;void setup() {size(500, 500);}void draw() {background(0);frameRate(30);stroke(255);index+=150;float a = (index / (float) width);theta = radians(a);translate(width/2,height);translate(0,-(height/2));branch(width/4);}void branch(float h) {h *= 0.66;if (h > 2) {pushMatrix();rotate(theta);line(0, 0, 0, -h);translate(0, -h);branch(h);popMatrix();pushMatrix();rotate(theta);line(0, 0, 0, h);translate(0, h);branch(h);popMatrix();}}

    Code:

    float theta,index;void setup() {size(500, 500);}void draw() {background(0);frameRate(30);stroke(255);index+=150;float a = (index / (float) width);theta = radians(a);translate(width/2,height);translate(0,-(height/2));branch(width/4);}void branch(float h) {h *= 0.66;if (h > 2) {pushMatrix();rotate(theta);line(0, 0, 0, -h);translate(0, -h);branch(h);popMatrix();pushMatrix();rotate(theta);line(0, 0, 0, h);translate(0, h);branch(h);popMatrix();}}


    link
    716 notas