94
edits
No edit summary |
No edit summary |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[File: | [[File:kurve1.jpg|200px]] [[File:kurve2.jpg|200px]] [[File:kurve3.jpg|200px]] | ||
[[File:bunt1.jpg|200px]] [[File:bunt2.jpg|200px]] [[File:bunt3.jpg|200px]] | |||
Durch drücken der Tasten 1,2,3,4 sowie a,b,c enstehen verschiedenste Muster. | |||
<source lang="java"> | |||
int[] farbeR; | |||
int[] farbeG; | |||
int[] farbeB; | |||
void setup() | |||
{ | |||
background(150); | |||
size(500,500); | |||
smooth(); | |||
strokeWeight(0.9); | |||
frameRate(30); | |||
} | |||
float winkel4; | |||
int a; | |||
int b; | |||
void draw() | |||
{ | |||
stroke(0); | |||
} | |||
float winkel=0; | |||
float winkel2=0; | |||
void keyPressed() | |||
{ | |||
if(key=='1') | |||
{ | |||
pushMatrix(); | |||
stroke(255,0,0); | |||
translate(250,250); | |||
rotate(winkel4); | |||
winkel4+=0.2; | |||
noFill(); | |||
rect(100,100,50,50); | |||
popMatrix(); | |||
} | |||
if(key=='2') | |||
{ | |||
pushMatrix(); | |||
stroke(255,0,0); | |||
translate(250,250); | |||
rotate(winkel); | |||
winkel+=0.2; | |||
noFill(); | |||
triangle(200,200,150,150,250,250); | |||
popMatrix(); | |||
} | |||
if(key=='3') | |||
{ | |||
pushMatrix(); | |||
stroke(255,0,0); | |||
translate(250,250); | |||
rotate(winkel); | |||
winkel+=0.2; | |||
noFill(); | |||
ellipse(50,50,150,150); | |||
popMatrix(); | |||
} | |||
if(key=='4') | |||
{ | |||
stroke(0); | |||
pushMatrix(); | |||
stroke(255,0,0); | |||
translate(250,250); | |||
rotate(winkel); | |||
winkel+=0.2; | |||
noFill(); | |||
beginShape(); | |||
curveVertex(0,100); | |||
curveVertex(50,50); | |||
curveVertex(150,50); | |||
curveVertex(200,150); | |||
curveVertex(350,250); | |||
endShape(); | |||
popMatrix(); | |||
pushMatrix(); | |||
stroke(255,255,0); | |||
noFill(); | |||
translate(250,250); | |||
rotate(winkel2); | |||
winkel2-=0.2; | |||
beginShape(); | |||
curveVertex(100,0); | |||
curveVertex(50,50); | |||
curveVertex(50,150); | |||
curveVertex(200,150); | |||
curveVertex(250,350); | |||
endShape(); | |||
popMatrix(); | |||
} | |||
} | |||
void keyReleased() | |||
{ | |||
if(key=='d') | |||
{ | |||
stroke(0); | |||
pushMatrix(); | |||
stroke(255,0,0); | |||
translate(250,250); | |||
rotate(winkel); | |||
winkel+=0.1; | |||
fill(255,255,0); | |||
beginShape(); | |||
curveVertex(0,100); | |||
curveVertex(50,50); | |||
curveVertex(150,50); | |||
curveVertex(200,150); | |||
curveVertex(350,250); | |||
curveVertex(0,100); | |||
endShape(); | |||
popMatrix(); | |||
pushMatrix(); | |||
stroke(255,255,0); | |||
fill(255,0,0); | |||
translate(250,250); | |||
rotate(winkel2); | |||
winkel2+=0.1; | |||
beginShape(); | |||
curveVertex(100,0); | |||
curveVertex(50,50); | |||
curveVertex(50,150); | |||
curveVertex(200,150); | |||
curveVertex(250,350); | |||
endShape(); | |||
popMatrix(); | |||
} | |||
if(key=='a') | |||
{ | |||
pushMatrix(); | |||
stroke(255,0,0); | |||
translate(250,250); | |||
rotate(winkel4); | |||
winkel4+=0.2; | |||
fill(252,110,0); | |||
rect(100,100,50,50); | |||
popMatrix(); | |||
} | |||
if(key=='b') | |||
{ | |||
pushMatrix(); | |||
stroke(255,0,0); | |||
translate(250,250); | |||
rotate(winkel); | |||
winkel+=0.2; | |||
fill(255,111,103); | |||
ellipse(50,50,150,150); | |||
popMatrix(); | |||
} | |||
} | |||
</source> | |||
[[File:bauhaus1.jpg|200px]] [[File:bauhaus2.jpg|200px]] [[File:bauhaus3.jpg|200px]] | |||
[[File:viereck1.jpg|200px]] [[File:viereck2.jpg|200px]] [[File:viereck3.jpg|200px]] | |||
[[File:d1.jpg|200px]] [[File:d2.jpg|200px]] [[File:d3.jpg|200px]] | |||
Line 61: | Line 237: | ||
<source lang="Java"> | |||
PFont font; | PFont font; | ||
PImage meinBild; | PImage meinBild; | ||
Line 361: | Line 538: | ||
} | } | ||
</source> | |||
[[File:bienenwabe.jpg|200px]] | [[File:bienenwabe.jpg|200px]] | ||
Verschiebt man die Maus nach rechts, verscheiben sich die "waben" nach rechts, verschiebt man die Maus nach links, verschieben sie sich nach links. Drückt man die recht Maus, werden sie schwarz umrandet. |
edits