A three dimensional grid system with distorted polygonal shapes on a white background
Processing code
PVector[] initDistCube(float w, float h, float o) {
return new PVector[] {
new PVector(random(o), 0),
new PVector(0, random(o)),
new PVector(0, h - random(o)),
new PVector(random(o), h),
new PVector(w - random(o), h),
new PVector(w, h - random(o)),
new PVector(w, random(o)),
new PVector(w - random(o), 0),
};
}
return new PVector[] {
new PVector(random(o), 0),
new PVector(0, random(o)),
new PVector(0, h - random(o)),
new PVector(random(o), h),
new PVector(w - random(o), h),
new PVector(w, h - random(o)),
new PVector(w, random(o)),
new PVector(w - random(o), 0),
};
}
void renderDistCube(PVector[] f) {
beginShape();
for (PVector v : f) vertex(v.x, v.y);
endShape(CLOSE);
}
beginShape();
for (PVector v : f) vertex(v.x, v.y);
endShape(CLOSE);
}
void setup() {
size(800, 800, P3D);
background(255);
noFill();
stroke(0);
translate(130, 180, 0);
scale(0.53);
rotateY(PI/4);
size(800, 800, P3D);
background(255);
noFill();
stroke(0);
translate(130, 180, 0);
scale(0.53);
rotateY(PI/4);
for (int u = 0; u < width; u+=100) {
for (int v = 0; v < height; v+=100) {
for (int w = 0; w < width; w+=100) {
pushMatrix();
translate(u, v, w);
strokeWeight(random(1, 3));
renderDistCube(initDistCube(100, 100, 80));
popMatrix();
}
}
}
saveFrame("distGrid.jpg");
}
for (int v = 0; v < height; v+=100) {
for (int w = 0; w < width; w+=100) {
pushMatrix();
translate(u, v, w);
strokeWeight(random(1, 3));
renderDistCube(initDistCube(100, 100, 80));
popMatrix();
}
}
}
saveFrame("distGrid.jpg");
}
Low resolution output images