Zaport-Mocap

This project used three moving bodies, in the form of BVH files, and tracks the hand movements of each. Over time, we can see the vertical motion of a person in motion. This project developed out of the idea of creating a drawing based of the movement of a person. The end result is different, though follows a similar process. I think that the aesthetic and conceptual components of the piece are weak, though I learned a lot throughout the process. In that sense, I am glad I was able to continue to develop my skills programming in Processing and Java.

Here’s a video:

Here’s a gif if you can’t see that:

Here’s a sketch:

This is one of the files from the Kinect:

Here are some frames from the sequence:


Here is the code that I edited to create this project. The rest of the code can be found here: https://github.com/CreativeInquiry/BVH-Examples/tree/master.

// Originally from http://perfume-dev.github.io/
 
BvhParser parserA = new BvhParser();
PBvh bvh1, bvh2, bvh3;
 
int pan = -800;
 
public void setup()
{
  size( 1000, 400, P3D );
  background( 0 );
  noStroke();
  frameRate( 30 );
 
  bvh1 = new PBvh( loadStrings( "zr101_03_2018_22_34_56_body1.bvh" ) );
  bvh2 = new PBvh( loadStrings( "zr201_03_2018_22_35_23_body1.bvh" ) );
  bvh3 = new PBvh( loadStrings( "zr301_03_2018_22_35_45_body1.bvh" ) );
 
  loop();
 
}
 
public void draw()
{
  //background( 20, 80, 120 );
 
  //camera
  float _cos = cos(millis() / 5000.f);
  float _sin = sin(millis() / 5000.f);
  //camera(width/4.f + width/4.f * _cos +200, height/2.0f-100, 550 + 150 * _sin, width/2.0f, height/2.0f, -400, 0, 1, 0);
 
  //ground 
  fill( color( 255 ));
  stroke(127);
  //line(width/2.0f, height/2.0f, -30, width/2.0f, height/2.0f, 30);
  stroke(127);
  //line(width/2.0f-30, height/2.0f, 0, width/2.0f + 30, height/2.0f, 0);
  stroke(255);
 
  pushMatrix();
  translate( width/2, height/2+300, 0);
  scale(-1, -1, -1);
 
  //model
  bvh1.update( millis() );
  bvh2.update( millis() );
  bvh3.update( millis() );
 
  bvh1.draw();
 
  int nBones = bvh1.parser.getBones().size();
  int mouseBoneIndex = (int) map(mouseX, 0, width, 0, nBones); 
 
  // println(mouseBoneIndex + " " + bvh1.parser.getBones().get(mouseBoneIndex));
 
  int L_HAND_BONE_INDEX_1 = 12;
  int R_HAND_BONE_INDEX_1 = 31;
  BvhBone lHandBone = bvh1.parser.getBones().get(L_HAND_BONE_INDEX_1);
  BvhBone rHandBone = bvh1.parser.getBones().get(R_HAND_BONE_INDEX_1);
  fill(20, 70, 120, 100); 
  strokeWeight(0); 
  pushMatrix();
  translate(pan, 0, 0);
  float r = lHandBone.absPos.z*0.05;
  ellipse(lHandBone.absPos.x, lHandBone.absPos.y, r, r);
  ellipse(rHandBone.absPos.x, rHandBone.absPos.y, r, r);
 
  line(
    lHandBone.absPos.x, lHandBone.absPos.y, lHandBone.absPos.z, 
    rHandBone.absPos.x, rHandBone.absPos.y, rHandBone.absPos.z); 
    popMatrix();
 
  bvh2.draw();
 
  int L_HAND_BONE_INDEX_2 = 12;
  int R_HAND_BONE_INDEX_2 = 31;
  BvhBone lHandBone2 = bvh2.parser.getBones().get(L_HAND_BONE_INDEX_2);
  BvhBone rHandBone2 = bvh2.parser.getBones().get(R_HAND_BONE_INDEX_2);
  strokeWeight(0); 
  fill(20, 40, 80, 100); 
  pushMatrix();
  translate(pan, 0, 0);
 
  ellipse(lHandBone2.absPos.x, lHandBone2.absPos.y, r, r);
  ellipse(rHandBone2.absPos.x, rHandBone2.absPos.y, r, r);
 
  line(
   lHandBone2.absPos.x, lHandBone2.absPos.y, lHandBone2.absPos.z, 
   rHandBone2.absPos.x, rHandBone2.absPos.y, rHandBone2.absPos.z); 
   popMatrix();
 
  bvh3.draw();
 
  int L_HAND_BONE_INDEX_3 = 12;
  int R_HAND_BONE_INDEX_3 = 31;
  BvhBone lHandBone3 = bvh3.parser.getBones().get(L_HAND_BONE_INDEX_3);
  BvhBone rHandBone3 = bvh3.parser.getBones().get(R_HAND_BONE_INDEX_3);
  strokeWeight(0); 
  fill(60, 100, 170, 100); 
  pushMatrix();
  translate( pan, 0, 0);
 
  ellipse(lHandBone3.absPos.x, lHandBone3.absPos.y, r, r);
  ellipse(rHandBone3.absPos.x, rHandBone3.absPos.y, r, r);
 
  line(
   lHandBone3.absPos.x, lHandBone3.absPos.y, lHandBone3.absPos.z, 
   rHandBone3.absPos.x, rHandBone3.absPos.y, rHandBone3.absPos.z); 
   popMatrix();
   pan = pan+4;
  popMatrix();
}