Skip to content

Commit

Permalink
Bubbles - Spheres and Wireframes
Browse files Browse the repository at this point in the history
I was originally playing around with the concept of having circles with
just lines outside the logo, and just filled with the color inside the
logo. To achieve the look I wanted, I really needed to draw the outside
ones first and then the opaque ones on top. I decided to try making it
3D and throwing a sphere in instead of an ellipse, and I think it was a
happy accident :)
  • Loading branch information
James Lawrence Turner committed Jan 30, 2015
1 parent 04574ab commit fc6d116
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

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

## Bubbles [Thu Jan 29, 2015]
![Bubbles](/bubbles/output.png?raw=true)

## Reconstruction (flat panels) [Wed Jan 28, 2015]
![Reconstruction (flat panels)](/reconstruction_flat_panels/output.png?raw=true)
65 changes: 65 additions & 0 deletions bubbles/bubbles.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
class Bubble {
float x, y, r, distanceRemaining;
Bubble(float x, float y, float r) {
this.x = x;
this.y = y;
this.r = r;
this.distanceRemaining = r;
}
void draw() {
boolean isOverLogo = false;
if(logoMask.get(int(x), int(y)) == color(255)) {
isOverLogo = true;
}
pushMatrix();
int z = -1;
if(isOverLogo) {
z = 1;
}
translate(x, y, z);
pushStyle();
noFill();
if(isOverLogo) {
int variance = int(random(30));
fill(variance, 121 + variance, 255);
noStroke();
}
ellipse(-r/2,-r/2, r, r);
popStyle();
popMatrix();
}
}

ArrayList<Bubble> bubbles;
PShape logo;
PGraphics logoMask;

void setup() {
size(500,500,OPENGL);

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.scale(0.75);
logoMask.fill(255);
logoMask.shape(logo);
logoMask.endDraw();

smooth();
background(color(255));
bubbles = new ArrayList<Bubble>();
for(int i = 0; i < 100; i++) {
bubbles.add(new Bubble(random(width), random(height), 20 + random(60)));
}
}

void draw() {
for(Bubble bubble : bubbles) {
bubble.draw();
}
}
Binary file added bubbles/output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions bubbles/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 bubbles/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 fc6d116

Please sign in to comment.