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.

Spirale

21. Oktober 2011




















void setup()
{
  size(600,600);      // def. fenstergroesse
  smooth();           // aktiviere antialiasing
  strokeWeight(5);    // linienbreite
  stroke(0,0,0,150);

  noLoop(); // stopt draw fuer einmalig
//  background(255);

}

void draw()
{
background(255);
 pushMatrix();
//    translate(mouseX,mouseY);
    translate(300,300);
    spirale();
 popMatrix();
}

void mousePressed()
{
   redraw(); //startet draw wieder
}

//zeichne spirale
void spirale()
{
  int y;
  int winkel = (int)random(20,30);
  int astwinkel = (int)random(40,120);
  int element = (int)random(30,50);
  int astelement = element - (int)random(10,20);
  int astmalen = element - (int)random(40,50);
  y = (int)random(20,50);

   pushMatrix();
     for(int i = 0 ; i < element; i++)
       {
       line(0,0,0,y); //Basiselement
       translate(0,y);
       rotate(radians(winkel));
       scale(.9);
       if (i==astmalen)
         {
         pushMatrix();
             rotate(-radians(astwinkel));
              for(int u = 0 ; u < astelement; u++)
                 {
                 line(0,0,0,y/5*4); //Basiselement
                 translate(0,y/5*4);
                 rotate(-radians(winkel));
                 scale(.9);
                 }

         popMatrix();
         }
       }

   popMatrix();

}