624
edits
WSebastian (talk | contribs) mNo edit summary |
WSebastian (talk | contribs) |
||
Line 130: | Line 130: | ||
<source lang="Java" highlight="1, 2, 3, 4, 5, 7, 8, 9" float seg = 0;> | <source lang="Java" highlight="1, 2, 3, 4, 5, 7, 8, 9" float seg = 0;> | ||
// Farbharmonisches Chaos | // Farbharmonisches Chaos | ||
// Sebastian Wolf | // Sebastian Wolf | ||
Line 275: | Line 274: | ||
Calendar now = Calendar.getInstance(); | Calendar now = Calendar.getInstance(); | ||
return String.format("%1$tm:%1$td:%1$ty %1$tH%1$tM", now); | return String.format("%1$tm:%1$td:%1$ty %1$tH%1$tM", now); | ||
} | |||
</source> | |||
<source lang="Java" highlight="1" float seg = 0;> | |||
// Circle-Klasse | |||
class Circle { | |||
float xPos; | |||
float yPos; | |||
float radius; | |||
float wanderTheta = random(TWO_PI); | |||
color clr; | |||
Circle (float axPos, float ayPos, float aradius, color aclr) { | |||
xPos = axPos; | |||
yPos = ayPos; | |||
radius = aradius; | |||
clr = aclr; | |||
} | |||
void render(float radius) { | |||
fill(clr); | |||
ellipse(xPos, yPos, radius*2, radius*2); // runde objekte | |||
/* rect(xPos, yPos, radius*2, radius*2); // 4eckige objekte | |||
triangle(xPos, yPos + radius, xPos - radius, yPos - radius, xPos + radius, yPos + radius); // 3eckige objekte | |||
beginShape(); | |||
for(int i = 0; i < random(random(50, 200)); i++) { | |||
vertex(random(xPos - radius, xPos + radius), random(yPos - radius, yPos + radius)); | |||
} | |||
endShape();*/ | |||
} | |||
void move() { | |||
float wanderOffset = random(-0.3, 0.3); | |||
wanderTheta += wanderOffset; | |||
xPos += cos(wanderTheta); | |||
yPos += sin(wanderTheta); | |||
} | |||
} | } | ||
</source> | </source> |
edits