24. September 2013
Verändere das Beispiel, mach andere Äste, Blüten, etc…
![Bildschirmfoto 2013-09-24 um 11.14.15](../../../../files/2013/09/Bildschirmfoto-2013-09-24-um-11.14.15-e1380014711353-300x300.png)
![Bildschirmfoto 2013-09-24 um 11.14.52](../../../../files/2013/09/Bildschirmfoto-2013-09-24-um-11.14.52-300x300.png)
![Bildschirmfoto 2013-09-24 um 11.14.42](../../../../files/2013/09/Bildschirmfoto-2013-09-24-um-11.14.42-298x300.png)
void setup() { size(600,600); // def. fenstergroesse randomSeed(millis()); // seed random smooth(); // aktiviere antialiasing strokeWeight(3); // linienbreite stroke(0,0,0,150); //noLoop(); } void draw() { background(255); pushMatrix(); translate(width *.5,height - 20); wurzel(7); popMatrix(); } void mousePressed() { redraw(); } // funktion void wurzel(int tiefe) { if(tiefe <= 0) // teste ob das ende erreicht worden ist { // zeichen blueten pushStyle(); int clr = (int)random(7,240); stroke(clr,222,200,190); fill(clr,222,200,190); ellipse(0,0,120,120); rotate(PI/3.0); fill(80,clr,120,120); noStroke(); rect(0,0,80,80); noStroke(); lights(); fill(80,120,clr,120); sphere(28); popStyle(); return; } // zeichne zweige int x; int y; int count = (int)random(3,6); for(int i = 0; i < count;i++) { x = (int)random(-100,100); y = -(int)random(10,150); line(0,30,x+mouseX,y+mouseY); ellipse(width/2, 280, 6,8); pushMatrix(); translate(x,y); scale(random(.3,.95)); wurzel(tiefe-1); popMatrix(); } }