|
|
Edit
| Attach
| Backlinks: Web All webs
| Printable
| History: r6 < r5 < r4 < r3 < r2
More Welcome to TeamYoveo? Presenting the Wheel of Time:
void setup()
{
size(300, 385); // Size should be the first statement
stroke(0); // Set line drawing color to white
framerate(30);
smooth();
noStroke();
background(255);
PFont font;
// The font must be located in the sketch's
// "data" directory to load successfully
font = loadFont("VT100.vlw");
fill(100);
textFont(font, 12);
text("applet by yves seiler", 5, 320);
fill(150);
text("press t for realtime", 5, 334);
text("press f for timelapse", 5, 348);
text("press c for standard color", 5, 362);
text("press r for random colors", 5, 376);
smooth();
}
int counter;
float tensecondr;
float tensecondg;
float tensecondb;
float secondr;
float secondg;
float secondb;
float minuter;
float minuteg;
float minuteb;
float tsredstart;
float tsgreenstart;
float tsbluestart;
float sredstart;
float sgreenstart;
float sbluestart;
float mredstart;
float mgreenstart;
float mbluestart;
float tsredchange;
float tsgreenchange;
float tsbluechange;
float sredchange;
float sgreenchange;
float sbluechange;
float mredchange;
float mgreenchange;
float mbluechange;
boolean randomcolor;
void draw()
{
if(keyPressed) {
if (key == 't') {
framerate(30);
}}
if(keyPressed) {
if (key == 'f') {
framerate(300);
}}
if(keyPressed) {
if (key == 'c') {
randomcolor = false;
}}
if(keyPressed) {
if (key == 'r') {
randomcolor = true;
}}
counter = counter + 1;
/// Standard-Farben definieren
if(randomcolor){
tsredstart = 50;
tsredchange = 0;
tsgreenstart = 120;
tsgreenchange = 0;
tsbluestart = 180;
tsbluechange = 0;
/// Sekunden
sredstart = 255;
sredchange = 0;
sgreenstart = 100;
sgreenchange = 0;
sbluestart = 0;
sbluechange = 0;
/// Minuten
mredstart = 140;
mredchange = 0;
mgreenstart = 200;
mgreenchange = 0;
mbluestart = 50;
mbluechange = 0;
}
/// Minuten
/// Farben
minuter = (counter%108000);
minuter = mredstart + minuter*mredchange/108000;
minuteg = (counter%108000);
minuteg = mgreenstart + minuteg*mgreenchange/108000;
minuteb = (counter%108000);
minuteb = mbluestart + minuteb*mbluechange/108000;
fill(255);
arc(150, 150, 320, 320, 0, 2*PI);
fill(minuter, minuteg, minuteb);
arc(150, 150, 300, 300, 0, (2*PI/60)*counter/1800); // /30 da fps = 30 => 1 Sekunde
fill(255);
arc(150, 150, 220, 220, 0, 2*PI);
/// Sekunden
//Farben
secondr = (counter%1800);
secondr = sredstart + secondr*(sredchange)/1800;
secondg = (counter%1800);
secondg = sgreenstart + secondg*sgreenchange/1800;
secondb = (counter%1800);
secondb = sbluestart + secondb*sbluechange/1800;
fill(secondr, secondg, secondb);
noStroke();
arc(150, 150, 200, 200, 0, (2*PI/60)*(counter%1800)/30); // /30 da fps = 30 => 1 Sekunde
fill(255);
arc(150, 150, 70, 70, 0, 2*PI);
/// Zehntelsekunden
///Farben
tensecondr = (counter%30);
tensecondr = tsredstart + tensecondr*tsredchange/30;
tensecondg = (counter%30);
tensecondg = tsgreenstart + tensecondg*tsgreenchange/30;
tensecondb = (counter%30);
tensecondb = tsbluestart + tensecondb*tsbluechange/30;
fill(tensecondr, tensecondg, tensecondb);
noStroke();
arc(150, 150, 50, 50, 0, (2*PI/60)*(counter%30)*3); // *3 da fps = 30 => 10. Sekunde
if (counter%1800 == 0){ //eine Minute ist um
if(randomcolor)
{
/// 10. Sekunden
tsredstart = random(0, 200);
tsredchange = random(0, 100);
tsgreenstart = random(0, 200);
tsgreenchange = random(0, 100);
tsbluestart = random(0, 200);
tsbluechange = random(0, 100);
/// Sekunden
sredstart = random(0, 200);
sredchange = random(0, 100);
sgreenstart = random(0, 200);
sgreenchange = random(0, 100);
sbluestart = random(0, 200);
sbluechange = random(0, 100);
/// Minuten
mredstart = random(0, 200);
mredchange = random(0, 100);
mgreenstart = random(0, 200);
mgreenchange = random(0, 100);
mbluestart = random(0, 200);
mbluechange = random(0, 100);
} else {
tsredstart = 50;
tsredchange = 20;
tsgreenstart = 120;
tsgreenchange = 20;
tsbluestart = 180;
tsbluechange = 20;
/// Sekunden
sredstart = 255;
sredchange = 20;
sgreenstart = 100;
sgreenchange = 20;
sbluestart = 0;
sbluechange = 20;
/// Minuten
mredstart = 140;
mredchange = 20;
mgreenstart = 200;
mgreenchange = 20;
mbluestart = 50;
mbluechange = 20;
}
}
redraw();
}
Edit
| Attach
| Backlinks: Web All webs
| Printable
| History: r6 < r5 < r4 < r3 < r2
More
|
This website has been archived and is no longer maintained.