Skip to content

Instantly share code, notes, and snippets.

@errete
Created July 25, 2014 12:18
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 errete/d10340230cd8808dfa34 to your computer and use it in GitHub Desktop.
Save errete/d10340230cd8808dfa34 to your computer and use it in GitHub Desktop.
Processing.org code for the cover of http://8tracks.com/danielrt/52
int i, j, gray;
int[] d=new int[3];
float[] disp=new float[2];
PGraphics n52;
PFont fnt=createFont("HelveticaNeueLTStd-Bd", 54);
void setup() {
size(1440, 1440);
background(223, 224, 175);
n52=createGraphics(90, 90); // raster "52."
n52.beginDraw();
n52.background(0);
n52.fill(255);
n52.textFont(fnt);
n52.textAlign(CENTER, TOP);
n52.text("52.", 45, 40);
n52.endDraw();
for (i=0; i<90; i++) {
for (j=0; j<90; j++) {
gray=round(red(n52.pixels[i+j*n52.width])/16);
d[0]=8-round(random(16)); // x-axis
d[1]=8-round(random(16)); // y-axis
d[2]=1+round(random(gray)/4); // z-axis
stroke(56, 50, 69, 64+round(random(gray)*8));
strokeWeight(8+round(random(gray)/2));
line(
i*16+d[0],
j*16+d[1],
i*16+d[0]+16*(i-45)/45*d[2],
j*16+d[1]+16*(j-45)/45*d[2]
);
}
}
save("52.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment