Wednesday, 10 December 2014

Project Rethink

Punktiert / Circle Project 


I have recently found a library named punktiert. This liabary contains an number of different examples of processing drawings that have objects within them that have different behaviours. This one was called Behaviour Attraction. In terms of what it does it is very simple. What happens is that the circles are given an attractor, in this case the mouse, and when the mouse reaches a certain distance to the objects they begin to become attracted to the mouse and depending on how far away they are from the mouse they move at different speeds to it. 

Although this is a relatively simple drawing, it has given me inspiration for another installation. I am going to create an installation that does use face tracking to create a circle that follows the face. Once this has been created I will add either a particle system to the circle that will allow the user to draw or draw inspiration from this piece of work and use the circle as the attractor and attract the other circles. 

video

I am also not going to be continuing with the face swap project. This is because despite me in the previous blog post stating that the PImage possibly being the answer to me being able to store faces, I have not be able to find a way to make this work. Along with this I have never been completely sold on the idea of creating the face swap as my installation, so therefore I will only be focusing on this face tracking project.

The Code 

import punktiert.math.Vec;
import punktiert.physics.*;
VPhysics physics;
BAttraction attr;
int amount = 200;

public void setup() {
  size(800, 600);
  noStroke();
  physics = new VPhysics();
  physics.setfriction(.4f);
  attr = new BAttraction(new Vec(width * .5f, height * .5f), 400, .1f);
  physics.addBehavior(attr);
  for (int i = 0; i < amount; i++) {
    float rad = random(2, 20);
    Vec pos = new Vec(random(rad, width - rad), random(rad, height - rad));
    VParticle particle = new VParticle(pos, 4, rad);
    particle.addBehavior(new BCollision());
    physics.addParticle(particle);
  }
}
public void draw() {
  background(255);
  physics.update();
  noFill();
  stroke(200, 0, 0);
  attr.setAttractor(new Vec(mouseX, mouseY));
  ellipse(attr.getAttractor().x, attr.getAttractor().y, attr.getRadius(), attr.getRadius());
  noStroke();
  fill(0, 255);
  for (VParticle p : physics.particles) {
    ellipse(p.x, p.y, p.getRadius() * 2, p.getRadius() * 2);
  }
}

Reference List 

Koehler, D., 2013. Punktiert. Lab-Eds, Available from: http://www.lab-eds.org/punktiert [Accessed 10 December 2014].

No comments:

Post a Comment