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
This commit is contained in:
Jaromil
2010-02-12 18:36:54 +01:00
parent ea0d4a4329
commit ae7b1ad056
172 changed files with 10535 additions and 665 deletions
+20
View File
@@ -0,0 +1,20 @@
float[][] distances;
float maxDistance;
size(200, 200);
background(0);
maxDistance = dist(width/2, height/2, width, height);
distances = new float[width][height];
for(int i=0; i<height; i++) {
for(int j=0; j<width; j++) {
float d = dist(width/2, height/2, j, i);
distances[j][i] = d/maxDistance * 255;
}
}
for(int i=0; i<height; i+=2) {
for(int j=0; j<width; j+=2) {
stroke(distances[j][i]);
point(j, i);
}
}