Digital Bauhaus Vorkurs/Projekte/Kleckse/Chaos: Difference between revisions

From Medien Wiki
(Created page with " int x = width/2; int y = height/2; int s = 10; int c = 255; int t = 10; int z = 255; int klexkomplex = 5; int dichteMin = -10; int dichteMax = 10; void setup () { size(70...")
 
m (source tag verwenden!)
Line 1: Line 1:
 
<source lang="Java">


int x = width/2;
int x = width/2;
Line 76: Line 76:


}
}
</source>

Revision as of 15:54, 17 April 2011

int x = width/2;
int y = height/2;
int s = 10;
int c = 255;
int t = 10;
int z = 255;
int klexkomplex = 5;
int dichteMin = -10;
int dichteMax = 10;



void setup () {

  size(700,700);
  smooth();
  noStroke(); 
  reset();
  background(256, 256, 256);
  fill( 120, 130, 200, 210);
 for (int i = 20; i < 400; i += 90) {
  ellipse(i, 0, i + i/2, 80);
  ellipse(i + i/2, 10, i*1, 100);
  ellipse(i + 480, 20, i + i*1.5, 300);
  ellipse(i + i/2, 10, i*1, 100);
 }


}

void reset() {
  
  background (255, 127, 36);
  x = (int)random(width);
  y = (int)random(height);
  s = (int)random(255);
  c = (int)random(238);
  
}  
  
void draw () {
  
 if(klexkomplex > (width/15) ) {
   return;
 }

  

  int i;
  for(i=0; i<klexkomplex; i=i+1) {
    x = x + (int)random(dichteMin,dichteMax);
    y = y + (int)random(dichteMin,dichteMax);
    c = (int)random(255);
    s = c + (int)random(dichteMin,dichteMax);
    t = (int)random(255);
    z = (int)random(dichteMin,dichteMax);
    fill(240, 128, 128, 200);
    
  }
  
  ellipse(x,y,s,s);
  ellipse(x+3,y+3,s+3,s+3);
  
 
  fill ( 120, 130, 200);
  ellipse(x,y,z,z);
  ellipse(x+3, y+3, z+3, z+3);
  ellipse(x+300,y, z, z);
  ellipse(x+300, y+3, z+3, z+3);
  ellipse(x-300, y, z, z);
  ellipse(x-300, y+3, z+3, z+3);
  
  

}