MWMR: Class 01

Class 01  |  Assignment Theme: BAAM! (Blended, Augmented & Mixed) reality. Intro, history, examples & exploration. 

Tech: Projection Mapping 101


For this week’s projection mapping assignment I wanted to make swirling water and project on glasses or coffee mug to simulate twirling effect. The liquid's movement will be triggered when someone is near the mugs or maybe the speed of the spinning water can be controlled by the leap motion?

Unfortunately, I have come to realize that I was a bit too ambitious for someone who does not have any experience with projection mapping. I learned that the code needed to run on MadMapper must be done in processing and with syphon libraries which is also in processing, however, my sketches was done in p5.js (a sketch I did for Nature of Code class). It took me a while to adjust the code accordingly and not without help from a fellow ITPers Sebastian and Matt, the resident.

 

SYPHON

This syphon tutorial was very helpful bridging the 3 software altogether. The workflow became much clearer after reading this tutorial.   >>> LINK <<<

 

 

 

Instead of the projecting onto coffee mugs, I used paper plates in the kitchen on the floor instead.

I wanted the particles to only be within the circle, but then I would have to adjust the code which now at this point I did not go back and adjust the code, because I wanted to play around and experiment with madmapper since this is the first time I’m using the software. I found it to be quite handy and very straight forward to use after watching few tutorials on youtube.

In terms of human interaction, I know that I’m still lacking on this part since the only human interaction I have is moving the mouse and the particles follow the mouse, but I’m very happy with the result!!

 

Also, I realized that the renderings in Syphon is different than in processing. As you can see (2 pictures below), there is no fading trails of the particles and I’m not sure why this happened.

 

The technical difficulties and connecting all the dots of all the things required was confusing but I'm very happy I was able to achieved this!


CODE

import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;

Mover[] movers= new Mover[6000];

void settings() {
  size(600, 600, P3D);
  PJOGL.profile=1;
}

void setup() {
  canvas = createGraphics(width, height);
  server = new SyphonServer(this, "Processing Syphon");

  for (int i = 0; i < movers.length; i++) {
    PVector pos = new PVector(random(width), random(height));
    PVector vel = new PVector();
    PVector acc = new PVector();
    movers[i] = new Mover(pos, vel, acc);
  }
}

void draw() {
  canvas.beginDraw();
  canvas.background(0, 50);
  for (Mover mover : movers) {
    mover.update();
    mover.display();
  }
  canvas.endDraw();
  image(canvas, 0, 0);
  server.sendImage(canvas);
}
 
class Mover {
  PVector position;
  PVector velocity;
  PVector acceleration;
  float topSpeed=4;
  
  Mover(PVector pos, PVector vel, PVector acc) {
   position =  pos;
   velocity = vel;
   acceleration = acc;
  }

  void update() {
    PVector mouse = new PVector(mouseX, mouseY);
    this.acceleration = mouse.sub(this.position);
    this.acceleration.setMag(0.075);
    this.velocity.add(this.acceleration);
    this.velocity.limit(this.topSpeed);
    this.position.add(this.velocity);
  }
  
  void display() {
    canvas.stroke(255);
    canvas.fill(250, 80);
    canvas.point(this.position.x, this.position.y);
  }
}