Willkommen auf unserem Seminar-Blog

Immer auf dem aktuellen Stand bleiben

Dieser Seminar-Blog befindet sich noch im Aufbau und wird in den kommenden Tagen entsprechend verfeinert.

Member Login

Lost your password?

Registration is closed

Sorry, you are not allowed to register by yourself on this site!

You must either be invited by one of our team member or request an invitation by email at viad.info {at} zhdk {dot} ch.

Grinda Rekursiv

28. Oktober 2011

the crowd

 
void setup()
{
  size(600,600);      // def. fenstergroesse

  randomSeed(millis());  // seed random

  smooth();           // aktiviere antialiasing
  strokeWeight(5);    // linienbreite
  stroke(0,0,0,150);

  noLoop();
}

void draw()
{
  background(255);

  pushMatrix();
    translate(width *.5,height - 20);
    wurzel(4);
  popMatrix();
}

void mousePressed()
{
   redraw();
}

// funktion
void grind()
{
   //körper
  arc(105, 35, 50, 50, -PI, 0);  // upper half of circle
 beginShape();
 vertex(80,35);
  vertex(80,55);
endShape();
 beginShape();
 vertex(130,35);
  vertex(130,55);
endShape();

//mund
 beginShape();
 vertex(100,40);
  vertex(110,40);
endShape();

//augen
ellipse(95,30,3,6);
ellipse(115,30,3,6);
}
void wurzel(int tiefe)
{
   if(tiefe <=0)    // teste ob das ende erreicht worden ist
   {
     // zeichen blueten
     pushStyle();
       int clr = (int)random(100,255);

     return;
   }

  // zeichne hügel
  int x;
  int y;
  int count = (int)random(1,8);
  for(int i = 0; i < count;i++)
  {
    x = (int)random(-100,100);
    y = -(int)random(10,150);
 {
   noFill();

grind();

 }

    pushMatrix();
      translate(x,y);
      scale(random(.3,.95));
      wurzel(tiefe-1);
     popMatrix();
  }
}