Wednesday, January 20, 2010
Squarillism
//Based on Ink by Johnny
PVector[] locations = new PVector[40];
void setup() {
size(800, 600, P2D);
background(0);
noStroke();
for(int i = 0; i < locations.length; i++) {
locations[i] = new PVector(random(0, width), random(0, height));
}
}
void draw() {
for(int i = 0; i < locations.length; i++) {
fill(locations[i].x/2, locations[i].y/2,random(0, 255),30);
int rectSize = int(random(1,10));
rect(locations[i].x + 400*sin(locations[i].x/10), locations[i].y + 300*sin(locations[i].y/10),rectSize,rectSize);
locations[i].x += random(-1, 1);
locations[i].y += random(-1, 1);
}
}
class PVector {
float x, y;
PVector(float ix, float iy) {
x = ix;
y = iy;
}}
PVector[] locations = new PVector[40];
void setup() {
size(800, 600, P2D);
background(0);
noStroke();
for(int i = 0; i < locations.length; i++) {
locations[i] = new PVector(random(0, width), random(0, height));
}
}
void draw() {
for(int i = 0; i < locations.length; i++) {
fill(locations[i].x/2, locations[i].y/2,random(0, 255),30);
int rectSize = int(random(1,10));
rect(locations[i].x + 400*sin(locations[i].x/10), locations[i].y + 300*sin(locations[i].y/10),rectSize,rectSize);
locations[i].x += random(-1, 1);
locations[i].y += random(-1, 1);
}
}
class PVector {
float x, y;
PVector(float ix, float iy) {
x = ix;
y = iy;
}}
info
submitted by: DARYL_Gammaviews: 652
Based on Ink by Johnny. No idea why the points accumulate along edges in that way, I must admit.
This sketch has a parent
comments
loading...
Add a comment: