顯示具有 Week08 標籤的文章。 顯示所有文章
顯示具有 Week08 標籤的文章。 顯示所有文章

2017年1月20日 星期五

80108003E_朱芳慶, Week08

2016-11-03 教學軟體設計 week08
1.     Leapmotion setup(PC/MAC)
1.1       LEAPMOTION App Store
1.2       Play

2.     Developer/Designer

程式碼
import de.voidplus.leapmotion.*;
LeapMotion leap;
void setup() {
  size(640, 480);
  leap =new LeapMotion(this);
}
void draw() {
  background(255);
  for(Hand hand : leap.getHands()){
    hand.draw();
  }
}
----------------------------------------------------------
import de.voidplus.leapmotion.*;
LeapMotion leap;
void setup() {
  size(640, 480);
  leap =new LeapMotion(this);
}
void draw() {
  background(255);
  for(Hand hand : leap.getHands()){
    //hand.draw();
    for(Finger finger : hand.getFingers() ){ 
      finger.draw();
      PVector pos = hand.getPosition();
      //println(pos);
      fill(255,0,0); ellipse(pos.x, pos.y, 100,100);
     }
  }  
}



2017年1月9日 星期一

2016 教學軟體設計 week8


2016-11-03

1.LEAPmotion
    1.0      LEAPmotion Setup(PC/Mac)
    1.1  LEAP motion on APP Store
    1.2  Play
2.      Developer /Designer














開啟範例:
























執行結果:
















實作1:
import de.voidplus.leapmotion.*;
LeapMotion leap;
void setup() {
  size(640, 480,P3D);
  leap = new LeapMotion(this);
}
void draw() {
  background(255);
  int fps = leap.getFrameRate();
  for (Hand hand : leap.getHands ()) {
    hand.draw();
  }
}  
實作1 執行結果:



















de.voidplus.leapmotion.*  文件
















實作2:顯示hand的座標
























實作3:在hand的座標上,顯示一個直徑100的紅色圓。























實作3 執行結果:
















實作4:在hand的座標上,顯示一個直徑100的紅色圓,但不顯示hand,
               功能為用hand接coin,hand與coin距離< 100,代表接到得10分。

























實作 4執行結果:



2016年12月15日 星期四

Week8 錡洛誼上課筆記

接金幣遊戲
import de.voidplus.leapmotion.*;  
LeapMotion leap;
void setup(){
  size(800,500,P3D);                   
  leap=new LeapMotion(this);
}
float coinX=240, coinY=0, coinVX=0, coinVY=3;    
int score=0;                                               
void draw(){
  background(255);                                 
  coinY += coinVY;                                   
  fill(255,0,0); ellipse(coinX, coinY, 60,60);
  if(coinY>480) {
  coinY=0;
  coinX=random(640);
  }
  for(Hand hand : leap.getHands()){          
   //hand.draw();
   PVector pos = hand.getPosition();
   //println(pos);
   fill(255,0,0); ellipse(pos.x, pos.y, 100,100);
   if(dist(pos.x, pos.y, coinX, coinY)<100){
     score += 10;                                             
     coinY=0;
     coinX=random(640);
   }
  }
  fill(0,255,0);
  textSize(40);
  text("Score:" + score, 500,100);
}