mirror of
https://github.com/dyne/FreeJ.git
synced 2026-06-16 12:59:33 +02:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user