As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Friday, October 5, 2018

Processing Experiment

Pointillism Experiemnt

Pointillism Processing Experiment

Our task was to take an existing code and make edits on it to change some aspect of the output. The code that I chose to remix was called Pointillism. When you run the code, dots appear on the screen and would enlarge as you move the mouse from the left to the right. So from here I wanted to play around with changing some of the variables to make the outcome look and act different. Below is my edited code.

/**
 * 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 img;
int smallPoint, largePoint;

void setup() {
  size(640, 360);
  img = loadImage("moonwalk.jpg");
  smallPoint = 2;
  largePoint = 60;
  imageMode(CENTER);
  noStroke();
  background(0);
}

void draw() { 
  float pointillize = map(mouseY, 0, width, smallPoint, largePoint);
  int x = int(random(img.width));
  int y = int(random(img.height));
  color pix = img.get(x, y);
  fill(pix, 128);
  ellipse(x, y, pointillize, pointillize);
}

I began by changing the background value from (255) to (0). This changed the background from white to black. I then decreased the smallest dot value and increased the largest dot value to create a more dynamic range in dot sizes. I then changed the code so that the dots enlarge when the mouse moves in the Y position (up/down) rather than the X position. My final alteration was changing the fill value from 128 to 600 which decreased the transparency of the dots.

Below is an example of the results of the original code:

Below is an example of the results of my edited code:

No comments:

Post a Comment