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.

Lektion 7: Uhr

21. November 2011

Abstrakte Uhr: Zuerst sehr abstrakt als schwarzes loch, danach mit Minutenangabe in der Mitte und den Sekunden als sich ständig verändernde Formen, die einen Kreis bilden. Code:
int s =second();
int m = minute();
int h = hour();


void setup()
{
  background(0);
  size(900, 900);
  smooth();
  PFont font;
  font = loadFont("CourierNewPS-BoldMT-48.vlw");
  textFont(font, 80);
  smooth();
  translate(width/2, height/2);
}
int angle= 0;
int x = 0;
int y= 0;

void draw()
{
  frameRate(1);
  float randR = random(0, 255);
  float randG = random(0, 255);
  float randB = random(0, 255);

  if (second()==59)
  {
    fill(0);
    ellipse(width/2, height/2, 100, 100);
  }
  String clockStr = str(minute());
  smooth();
  text(clockStr, (width/2)-40, (height/2)+20);

  int trans=0;

  fill(0, 0, 0, 20);
  rect(0, 0, width, height);
  stroke(255);
  noFill();

  translate(width / 2 + cos(second()) * second()-trans, height / 2 + sin(second()) * second()-trans);
  println("sekunde: " + second());

  noStroke();
  fill(255, 255, 255, 30);
  rotate(second());
  beginShape();
  vertex(second(), 60); 
  vertex(120, second()/180);
  vertex(second()/240, 360);
  endShape(CLOSE);
  rotate(second());
  angle = angle + second();
  trans+=2;
}