Files
FreeJ/scripts/processing/basic/array.pde
Jaromil ae7b1ad056 progresses on processing script
processing-js 0.4 has been merged in some relevant parts
basic and topic scripts added for test
color handling fixed, more scripts show up now
2010-02-12 18:36:54 +01:00

24 lines
434 B
Plaintext

size(200, 200);
float[] coswave = new float[width];
for(int i=0; i<width; i++) {
float ratio = (float)i/(float)width;
coswave[i] = abs( cos(ratio*PI) );
}
for(int i=0; i<width; i++) {
stroke(coswave[i]*255);
line(i, 0, i, width/3);
}
for(int i=0; i<width; i++) {
stroke(coswave[i]*255/4);
line(i, width/3, i, width/3*2);
}
for(int i=0; i<width; i++) {
stroke(255-coswave[i]*255);
line(i, width/3*2, i, height);
}