// by dave @ beesandbombs.tumblr.com //////////////////////////////////// int[][] result; float time; void setup() { setup_(); result = new int[width*height][3]; } void draw() { for (int i=0; i> 16 & 0xff; result[i][1] += pixels[i] >> 8 & 0xff; result[i][2] += pixels[i] & 0xff; } } loadPixels(); for (int i=0; i= .5) t += .5; background(0); pushMatrix(); translate(width/2, height/2); fill(0,20,255); for (int i=-N; i<=N; i++) { for (int j=-N; j<=N; j++) { x = -sp*(i+t); y = sp*.866*j; if(j%2 != 0){ x += .5*sp; x *= -1; } ellipse(x,y,d,d); } } fill(20,255,0); pushMatrix(); rotate(TWO_PI/3); for (int i=-N; i<=N; i++) { for (int j=-N; j<=N; j++) { x = -sp*(i+t); y = sp*.866*j; if(j%2 != 0){ x += .5*sp; x *= -1; } ellipse(x,y,d,d); } } popMatrix(); fill(255,10,35); pushMatrix(); rotate(TWO_PI*2/3); for (int i=-N; i<=N; i++) { for (int j=-N; j<=N; j++) { x = -sp*(i+t); y = sp*.866*j; if(j%2 != 0){ x += .5*sp; x *= -1; } ellipse(x,y,d,d); } } popMatrix(); popMatrix(); }