Februar 21, 2012
Zum Einstieg haben wir grundlegende Funktionen in Processing wie Zeichnen, Funktionen, Schleifen und Interaktionen repetiert.LINESsize(500,500); background(255); smooth(); stroke(0,255,0); strokeWeight(3); line(10,10,200,200); stroke(255,255,0); strokeWeight(4); line(50,100,300,300); stroke(0,0,255); strokeWeight(6); line(50,400,500,300); stroke(0,255,255); strokeWeight(8); line(400,100,300,300); save("lines.png");ELLIPSE / ALPHAWERTint xPos=10; int yPos=10; void setup() { size(500,500); background(0); } void draw() { //background(255); noStroke(); fill(0,255,0,100); ellipse(xPos,yPos,50,50); } void mouseDragged() { xPos=mouseX; yPos=mouseY; }MOUSEPRESSEDint value = 0; void setup() { size(500,500); noStroke(); smooth(); } void draw() { fill(value); rect(250, 250, 100, 100); } void mousePressed() { if(value == 0) { value = 255; } else { value = 0; } }KEYPRESSED<pre> void setup() { size(500,500); noStroke(); background(255); fill(0); } void draw() { if(keyPressed) { if (key == 'b' || key == 'B') { rect(100,100,100,100); } } }