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, June 13, 2014

Chris & Skyler: Processing

We were just messing around with a processing file that had 2 squares that responded to the mouse position. We added a third square that behaves increasingly random as mouseX changes. Just interesting to watch the changes.


/**
 * Mouse 2D.
 *
 * Moving the mouse changes the position and size of each box.
 * THere is a third box that moves a little randomly
 */

void setup()
{
  size(640, 360);
  noStroke();
  rectMode(CENTER);
}

void draw()
{  
  background(51);
  fill(255, 204);
  rect(mouseX, height/2, mouseY/2+10, mouseY/2+10);
  fill(255, 204);
  int inverseX = width-mouseX;
  int inverseY = height-mouseY;
  rect(inverseX, height/2, (inverseY/2)+10, (inverseY/2)+10);
  rect(mouseX*1.1+random(2)*mouseX, height/1.1, mouseY/2+12, mouseY/1.3+10);
}

No comments:

Post a Comment