/** * Drill Block by Robert Twomey * built from * Pointillism by Daniel Shiffman. * * Mouse horizontal location controls size of dots. * Creates a simple pointillist effect using ellipses colored * according to pixels in an image. */ PImage a; int x, y; class DrillBlock { DrillPt points[10]; byte value; byte numpoints; DrillBlock(byte _value) { this.setVal(_value); } void setVal(byte _value) { this.value = map(0, 255, 0, 10, _value); switch(this.value) { case 0: points[0]. } void setup() { //a = loadImage("eames.jpg"); //a = loadImage("six.jpg"); a = loadImage("six_160_10levels.jpg"); size(a.width*5, a.height*5); noStroke(); background(128); //smooth(); x=0; y=0; } void draw() { float pointillize = map(mouseX, 0, width, 2, 18); //int x = int(random(a.width)); //int y = int(random(a.height)); x+=1; if(x>=a.width) { x=0; y+=1; if(y>=a.height) y=0; }; color pix = a.get(x, y); fill(pix); //stroke(pix); rect(x*5, y*5, 5, 5); }