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.

Ornament v1 (trashy)

8. November 2010

In this exercise, we were to create an ornament which can be extended in all directions. In a kind of way, this is also extend-able but not in any way symmetrical. It still is pretty in such a way that the motive gets thicker when several of them overlap.
void setup()
{
  size(600,600);      // def. fenstergroesse


  smooth();           // aktiviere antialiasing
  strokeWeight(1);    // linienbreite
}

void draw()
{
  background(255);    // def. hintergrundfarbe
  float rotator =0.0;
  int fade = 0;
  fade+=1;
  for(int x = 0; x <= width; x+=50)
  {
    for(int y = 0; y <= height; y+=50)
    {
      pushMatrix();
      translate(x,y);
      scale(.3);
      //smiley();          // funtions aufruf
      graphic((int)random(2000), 0, 0,(fade%100));
      popMatrix();
      fade+=1;
    }
  }
}

void keyPressed()
{
  switch(key)
  {
  case 's':
    save("screenShot.jpg");
    println("save the screen to screenShot.jpg");
    break;
  }
}

// funktion
void smiley()
{
  noFill();
  ellipse(0,0,180,180);  // kopf

  fill(0);
  ellipse(0 - 30,0 - 30,20,5);  // linkes augen
  ellipse(0 + 30,0 - 30,20,5);  // rechtes augen

  noFill();
  arc(0,0,100,100,radians(20),radians(180-20));  // mund
}
//funktion
void graphic(int amount, float x, float y, int al) {
  float a = 0.0;
  float inc = TWO_PI/100.0;

  beginShape();
  vertex(x,y);
  for(int i=0; i<amount;i++) {
    stroke(0,0,0,al);
    vertex(x+=(sin(a)*5*cos(a)*6)+0.1,y+=(cos(a)*5+0.1));
    rotate(PI/4);
    a+=inc;
  }
  endShape();
}