fabianmoronzirfas
11/7/2013 - 1:53 PM

These sketches are part of the course ["Eingabe, Ausgabe. Grundlagen der prozessorientierten Gestaltung"](https://incom.org/workspace/4693)

/**
 * Hi tomie89
 * I found the error
 * size() and background() where in original sketch within the loop
 * with size it is okay but ugly and unnecessary.
 * but the backgound() allways overwrote our display
 * see the fixed code below
 */
 
 
size(700, 500);
background(0);
noFill();
stroke(255);
rectMode(CENTER);
int rectsize = 315;

for(int i = 0; i < 360; i = i + 45){
  pushMatrix();
  translate(width/2, height/2);
  rotate(radians(i));
  rect(0, 0, rectsize, rectsize);
  rectsize = rectsize -20;
  if(rectsize <=0){
    break;
  }
  popMatrix();
println(i);
}

/*

This is the old code with the error
rectMode(CENTER);
for(int i = 0; i < 360; i+=45){

  size(700, 500);
  background(255, 0, 0); // <-- This produces the error
  fill(255,10);
  pushMatrix();
  translate(width/2, height/2);
  rotate(radians(i*2));
  rect(0, 0, 315, 315);
  popMatrix();
println(i);
}

*/