Ulmeier

Aus ProgrammingWiki
Archivierte Version vom 2009-12-05T14:02:10+00:00. Aktuelle Version

<eval id="4b1a67e136b71"></eval>


float[] coswave = new float[width];

for (int i = 0; i < width; i++) {

 float amount = map(i, 0, width, 0, PI);
 coswave[i] = abs(cos(amount));

}

for (int i = 0; i < width; i++) {

 stroke(coswave[i]*255);
 line(i, 0, i, height/3);

}

for (int i = 0; i < width; i++) {

 stroke(coswave[i]*255 / 4);
 line(i, height/3, i, height/3*2);

}

for (int i = 0; i < width; i++) {

 stroke(255 - coswave[i]*255);
 line(i, height/3*2, i, height);

}