int x = 150; int y = 300; int d = 5; //diameter int n = 5; //recursions void setup() { size(300,300); background(0); noFill(); stroke(255); smooth(); noLoop(); } void draw() { Curve (x, y, d, n); } void Curve (float x, float y, float d, int num) { bezier(-100, 0, x, y, x-n*d, y-n*d, 500, 0); if (num > 1) { num = num - 1; int branches = 3; for (int i = 0; i < branches; i++) { float a = random(0, 8); float newx = x + a * num; float newy = y + a * num; pushMatrix(); rotate(num*a); Curve (newx, newy, d*1.5, num); popMatrix(); } } } void Leaf(float x, float y, float dir) { ellipse(x,y-100,10,10); }