-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mode.id=processing.mode.java.JavaMode | ||
mode=Java |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.