2015年3月16日 星期一

week4

import de.voidplus.leapmotion.*;
LeapMotion leap;
void setup() {
  size(600, 600, P3D);
  leap=new LeapMotion(this);
}
void draw() {
  background(255);
  for (Hand hand : leap.getHands ()) {
    hand.draw();
    float angle=hand.getYaw();
    PVector pos=hand.getPosition();
    translate(pos.x, pos.y, pos.z);
    rotateY(-radians(angle));
    fill(128);
    stroke(0);
    box(100);
  }
}

沒有留言:

張貼留言