// Cubicles // David Bollinger, Sep 2006 // http://www.davebollinger.com // for Processing 0115 Beta // (updated to 0123) /** Click mouse to generate next
*/ float [] dxs; float [] dys; Grid grid; ArrayList movers; MultiPalette pal; float branchLikelihood; float paintLikelihood; int margin = 50; float minx, miny, maxx, maxy; void setup() { size(300,300,P3D); loadPixels(); minx = miny = -margin; maxx = width + margin - 1; maxy = height + margin - 1; grid = new Grid(width, height, margin); pal = new MultiPalette("palettes.jpg"); movers = new ArrayList(); dxs = new float[6]; dys = new float[6]; float [] angles = { 30f, 90f, 150f, 210f, 270f, 330f }; for (int i=0; i<6; i++) { dxs[i] = cos(angles[i]*PI/180f); dys[i] = sin(angles[i]*PI/180f); } next(); } void draw() { for (int i=0, sz=movers.size(); i0; i--) movers.add( new Walker(random(grid.width), random(grid.height), int(random(6))) ); branchLikelihood = random(0.02,0.10); paintLikelihood = random(0.8f, 1.0f); pal.select(); } void mousePressed() { next(); }