2014年4月28日 星期一

第十一週上課內容

下載

Latest Kinect for Windows SDK
Latest Kinect for Windows Developer Toolkit
http://www.microsoft.com/en-us/kinectforwindowsdev/Downloads.aspx

FAAST 32Bits
http://projects.ict.usc.edu/mxr/faast/

1. Kinect 可以使用(SDK安裝,插入硬體)

2. FAAST 下載/使用(如果出現msvcp110.dll問題,就下載Visual Studio 2012 Redistributable檔)

2.1 試著寫FAAST的手勢判斷

目標: Kinect 的一個作品: 一馬當先

(手舉起來/手往右/手往左)









int stage=0,hourseID=0,oldTime=0; void setup(){ size(600,400); textSize(40); } void draw(){ if(stage==0){ background(0); text("Wait for your Input/UP",100,100); }else if(stage==1){ background(255,0,0); text("Select your hourse",100,100); text("Now Select"+ hourseID,200,200); oldTime=millis(); }else if(stage==2){ background(0,255,0); text("Run Run my Hourse"+hourseID,100,100); int nowTime=millis(); int t=int((nowTime-oldTime)/1000); text("Running "+t,200,200); if(t>20)stage=3; }else if(stage==3){ background(0,0,255); }else background(255,255,0); } void keyPressed(){ if(keyCode==UP){ if(stage==0) stage=1; else if(stage==1) stage=2; else if(stage==2) stage=3; } if(keyCode==RIGHT)hourseID=(hourseID+1)%4; if(keyCode==LEFT)hourseID=(hourseID-1+4)%4; }

沒有留言:

張貼留言