Skip to content

Commit

Permalink
First draft of Reconstruction
Browse files Browse the repository at this point in the history
Took a first pass at reconstruction, a piece focused on the URX logo
using only cube based shapes in two angles. The logo is illustrated by
the cube's positioning over the logo.
  • Loading branch information
James Lawrence Turner committed Jan 29, 2015
0 parents commit 04574ab
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# James Lawrence Turner's Code Art Sketchbook

#### Copyright James Lawrence Turner, 2015, All Rights Reserved

## Reconstruction (flat panels) [Wed Jan 28, 2015]
![Reconstruction (flat panels)](/reconstruction_flat_panels/output.png?raw=true)
Binary file added reconstruction_flat_panels/output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions reconstruction_flat_panels/reconstruction_flat_panels.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
class Block {
float x, y, z, rotation, w, h, d;
int brightness;
Block(float x, float y, float z, float rotation, float w, float h, float d, int brightness) {
this.x = x;
this.y = y;
this.z = z;
this.rotation = rotation;
this.w = w;
this.h = h;
this.d = d;
this.brightness = brightness;
}
void draw() {
pushMatrix();
translate(x, y, z);
rotateY(rotation);
pushStyle();
fill(brightness, 50);
if(logoMask.get(int(x), int(y)) == color(255)) {
int variance = int(random(30));
fill(variance, 121 + variance, 255);
}
box(w, h, d);
popStyle();
popMatrix();
}
}

ArrayList<Block> b;
PShape logo;
PGraphics logoMask;

void setup() {
size(5000,5000,OPENGL);
b = new ArrayList<Block>();
logo = loadShape("urx-logo.svg");
logo.disableStyle();
logo.scale(width / logo.width);

logoMask = createGraphics(width, height);
logoMask.beginDraw();
logoMask.background(0);
logoMask.translate(0, height/4 + height / 16);
logoMask.fill(255);
logoMask.shape(logo);
logoMask.endDraw();

for(int i = 0; i < 5000; i++) {
b.add(new Block(random(width), random(height), random(200), (random(100) < 50 ? -PI/4 : PI), 10, 200, 100, int(random(150)) + 75));
}
background(255);
smooth();
noStroke();
noLoop();
}

void draw() {
lights();
fill(0);
rect(0, height/4, width, height/2);
for(Block bl : b) { bl.draw(); }
save("output.png");
}
2 changes: 2 additions & 0 deletions reconstruction_flat_panels/sketch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mode.id=processing.mode.java.JavaMode
mode=Java
20 changes: 20 additions & 0 deletions reconstruction_flat_panels/urx-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 04574ab

Please sign in to comment.