/* Adam Murray, 2009 */ float maxScale = 0; ArrayList sqrs = new ArrayList(); float b = -20; float g = 0; float bDelta = -0.77; float gDelta = -1; void setup() { size(450,450); maxScale = Math.max(width,height)/14.0; //smooth(); strokeWeight(1.7); noFill(); for(int i=0; i<35; i++) { sqrs.add(new SquareZoomer(random(0.075)-0.01, random(.1)+0.1)); } } void draw() { background(0,g,b); b += bDelta; g += gDelta; if(b > 100 || b < -200) bDelta *= -1; if(g > 80 || g < -190) gDelta *= -1; for(int i=0; i maxScale || this.zoom < 0) { this.zoomDelta *= -1; } } void drawSquare(int x, int y, int size, float angle, float zoom) { pushMatrix(); translate(x,y); rotate(angle); scale(zoom); int halfSize = size/2; rect(-halfSize,-halfSize,size,size); /* rect(0,0,size,size); rect(halfSize,halfSize,size,size); rect(halfSize,-halfSize,size,size); rect(-halfSize,halfSize,size,size); */ popMatrix(); } }