Skip to content

Instantly share code, notes, and snippets.

@uechoco
Created November 18, 2010 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uechoco/704676 to your computer and use it in GitHub Desktop.
Save uechoco/704676 to your computer and use it in GitHub Desktop.
This is Processing scketch that represents blue ocean wonderful power.
void setup() {
size(300, 300);
colorMode(HSB, 100);
background(100);
noLoop();
}
void draw() {
int cx = width / 2;
int cy = height / 2;
int sugar = 20;
int maxr2 = (cx - sugar) * (cx - sugar) + (cy - sugar) * (cy - sugar);
for (int i = 0; i < 13000; i++) {
int x = (int)random(width);
int y = (int)random(height);
int r2 = (cx - x) * (cx - x) + (cy - y) * (cy - y);
stroke(40 + r2 * 20 / maxr2, r2 * 90 / maxr2 + 10, 100, 80);
strokeWeight(r2 * 3 / maxr2 + random(1,4));
point(x, y);
}
PFont font = loadFont("Impact-18.vlw");
fill(0);
textFont(font, 18);
textAlign(RIGHT);
text("Marine Energy\n2008 uechoco", width - 20, height - 40);
}
void mousePressed() {
save("for_pde_viewer.jpg");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment