2015年3月9日 星期一

第三周課堂

第二週課堂

控制方塊




-----------------------------------------------------------------

剪刀石頭布


import de.voidplus.leapmotion.*;
LeapMotion leap;
void setup(){
  size(800,600,P3D);
  leap = new LeapMotion(this);
}
void draw(){
  background(255);
  println(leap.getHands().size());
  fill(255,0,0);
  textSize(40);
  for(Hand hand : leap.getHands()){
    if(hand.isRight()){
      text("right:"+hand.getOutstrechtedFingers().size(),400,300);
    }else
      text("left:"+hand.getOutstrechtedFingers().size(),200,300);
  }
}

沒有留言:

張貼留言