IFD:GenerativeBauhaus WS2012/Melissa: Difference between revisions

From Medien Wiki
Line 14: Line 14:
Von der Figur..
Von der Figur..


[[File:LinieNotClicked.png]]
[[File:LinieNotClicked.png|600px|thumb|right|border|]]


..zur Linie.
..zur Linie.


[[File:LinieClicked.png]]
[[File:LinieClicked.png|600px|thumb|right|border|]]
 
 
<source lang="java">
void setup() {
  size(800, 600);
}
 
 
void draw() {
  background(255);
 
  if(mousePressed == true) {
  fill(255);
  } else {
    fill(0);
  }
 
  beginShape();
  curveVertex(400,400);
  curveVertex(400,400);
  curveVertex(410,380);
  curveVertex(400,360);
  curveVertex(390,380); 
  curveVertex(410,390);
  curveVertex(420,390);
  curveVertex(420,380);
  curveVertex(422,390);
  curveVertex(440,380);
  curveVertex(442,390);
  curveVertex(443,380);
  curveVertex(446,380);
  curveVertex(447,390);
  curveVertex(452,390);
  curveVertex(452,380);
  curveVertex(454,390);
  curveVertex(464,385);
  curveVertex(460,380);
  curveVertex(458,385);
  curveVertex(460,390);
  curveVertex(470,400);
  curveVertex(475,390);
  curveVertex(475,390);
 
  point(420,360);
  point(452,360);
 
  endShape();
}


==Form==
==Form==

Revision as of 00:38, 13 November 2012

Punkt

'Punkt' aus Punkten.

PunktAusPunkten.png

Linie

'Linie' aus Linien.

Linie.png


Von der Figur..

LinieNotClicked.png

..zur Linie.

LinieClicked.png


<source lang="java"> void setup() {

 size(800, 600);

}


void draw() {

 background(255);
 
 if(mousePressed == true) {
 fill(255);
 } else {
   fill(0);
 }
 beginShape();
 curveVertex(400,400);
 curveVertex(400,400);
 curveVertex(410,380);
 curveVertex(400,360);
 curveVertex(390,380);  
 curveVertex(410,390);
 curveVertex(420,390);
 curveVertex(420,380);
 curveVertex(422,390);
 curveVertex(440,380);
 curveVertex(442,390);
 curveVertex(443,380);
 curveVertex(446,380);
 curveVertex(447,390);
 curveVertex(452,390);
 curveVertex(452,380);
 curveVertex(454,390);
 curveVertex(464,385);
 curveVertex(460,380);
 curveVertex(458,385);
 curveVertex(460,390);
 curveVertex(470,400);
 curveVertex(475,390);
 curveVertex(475,390);
 point(420,360);
 point(452,360);
 endShape();

}

Form

'Form' aus Formen.

FormAusFormen.png


<source lang="java"> void setup () {

 size (800,600);
 background (255);
 

}

int value = 0; int counter = 0;

void draw () {

 fill (0);
 
 if (counter >= 1) {
   triangle (40,250,50,10,70,550);
   triangle (48,18,120,30,140,18);
   triangle (48,80,120,92,140,80);
   }
 
 if (counter >= 2) {
   ellipse (200,250,200,200);
   }
   
   fill (255);
 if (counter >= 3) {
   ellipse (220,270,130,70);
   }
   
   fill (0);
 if (counter >= 4) {
   rect (350,250,25,200);
   }
   
 if (counter >= 5) {
   triangle (370,265,380,230,450,265);
   }
   
 if (counter >= 6) {
   rect (480,200,200,200);
   }
   
   fill (255);
 if (counter >= 7) {
   rect (530,260,30,180);
   rect (600,260,30,180);
   rect (530,200,150,20);
   }
   
 }

void mouseClicked() {

 counter = counter +1;
 if (value==0) {
   value = 255;
 }

}