Einblick in die generative Gestaltung mit «Processing»

Sechs Kursabende à vier Stunden an der EB Zürich

Kurskonzeption und Leitung Hanna Züllig


< back

						/*
Autor: Sandro Azzati
Kurs: Einblick in die generative Gestaltung mit processing ip971311
Kursleitung: Hanna Zuellig
Veroeffentlicht unter der creative common license Attribution-NonCommercial-ShareAlike
CC BY-NC-SA  http://creativecommons.org/licenses/
*/

float angle = 0;
float angleinc = .5;
float a = 25; // Transparenz - Alphakanal
float xyPos; // Positon zentrum Formen
float fr = 8; // Frame Rate

void setup() {
  size(500, 500);
  rectMode(CENTER);
  background(0);
  frameRate(fr);
  smooth();
  //noLoop();
}

void draw() {
  fill(0, 40, 0, a);
  rect(width/2, height/2, width, height);
  for (xyPos =width/8; xyPos< width/2; xyPos += .25) {
    drawEllipse();
  }
} //end draw

void drawEllipse() {
  pushMatrix();
  translate(xyPos, xyPos);
  rotate(radians(angle));
  fill(255);
  noStroke();
  //ellipse(xyPos,0,2,2);
  ellipse( xyPos, 0, 2, 32);
  angle = angle + angleinc;
  popMatrix();
}

void mousePressed() {
 
  noLoop();
}

void mouseReleased() {
  loop();
}