2016年12月29日 星期四

Week16 施柏豪上課筆記

上課內容紀錄

老師上課首先提到他所指導的研究團隊所開發的VR噴漆模擬效果,在Steam平台,已經有國外的Infectious Ape公司開發上架,而且更新之後的功能做的又更多,大家聽到這消息感到十分沮喪,不過葉老師說應該往正面的方向想,他的研究團隊學生很努力,能追上國外最新的技術能力,算是很值得肯定的!
該遊戲在Steam平台上的連結:Kingspray Graffiti VR
VR效果如下影片:
個人心得:
噴漆向來被視為街頭文化或是非主流文化,猶記得高中時代在一中街閒晃,常常可以看到巷子裡斑駁的牆壁上是一個個風格迥異的噴漆創作,那時覺得噴漆也是一種藝術創作,不過通常在街頭牆面等地方,隨意噴漆可能會被環保局處罰,在這種情況下,HTC Vive與VR噴漆應用,反倒提供了人們一個情境體驗噴漆與創作,我覺得這樣的應用很不錯,VR科技從這個虛擬角度切入很適合。

3D scanning
老師接著帶我們了解近年來,3D掃描重要技術演進

  • 深度感測
    利用3D深度感應器去照每一個跟自己的距離利用平板掃描3D世界。
    Ex:voxxlr這個網站提供了戶外自然景觀與室內環境等大範圍的3D模型掃描效果,比Google街景還逼真許多,超級特別的。

  • 光波掃描 - ToF camera
    針對待測場景發射一參考光束,藉由計算回光的時間差或相位差,來換算被拍攝景物的距離,以產生深度資訊,此外再結合傳統的相機拍攝,以獲得2維影像資訊。
The Digital Michelangelo Project 數位米開朗基羅計畫
3D model of Michelangelo's 5-meter statue of David



3D模型轉換方塊模型
下載Vinbox程式 與bunny 模型檔案,在cmd視窗中,執行binvox程式,產生副檔名為.binvox 的文件,將此文件丟到viewvox程式中,可進行3D方塊模型預覽。

1.兔子bunny的3D模型檔案
2.使用binvox程式,在cmd中,key指令產生Vinbox檔
3.完成讀入Vinbox
4.瀏覽Vinbox檔案,將可以看到方塊狀的bunny,類似麥塊遊戲中的物件



  • 使用Processing程式讀取3D模型、觀看3D效果

程式碼如下:
PShape bunny;
float ry;

void setup(){
  size(400,400,P3D);
  bunny = loadShape("bunny.obj");
}
void draw(){
  background(230,0,0);
  lights();
  translate(width/2, height/2+ 150, -200);
  scale(100,100,100);
  rotateZ(PI);
  //rotateY(ry);
  rotateX(radians(mouseY));
  rotateY(radians(mouseX));
  shape(bunny,0,0);
  
  ry += 0.02;
}

學習心得:

今天的課程內容偏向電腦圖學與多媒體應用,我對這一塊不熟悉,老師提到的東西都蠻讓我感到驚奇的,在老師引導下,我自己會針對相關的項目再查詢關鍵字,常能發現原來某某大公司也在開發這些專案項目,而Processing實作某個互動應用,是一個能讓我體會原來寫程式也能很藝術的過程,也證明了跨一個領域,隔行如隔山,在多媒體互動應用這塊,我還有許多需要學習的。



20161229 彩鳳筆記

3D Scan
Voxxlr
http://www.voxxlr.com/



Project Tango Test in my room

Kinectfusion


ToF Camera Noise of Kinect for Windows Ver.2.0



3D Laser Scanner

Moedls - Mobile 3d Laser Scanner


Scanning the David




Track finger with the Wii remote


Low-Cost Multi-touch Whiteboard using the Wii remote


Binvox
Tutorial Tuesday: Binvox

Download

Run cmd



Google bunny obj then save it


Extract the file and drag to cmd (remember to space between 2 links)


Download viewvox


Processing



Ctrl + K to open folder, then drag the data object to Processing sketch
Rocket
PShape bunny;

void setup(){
  size(400,400,P3D);
  bunny = loadShape("rocket.obj");
}
void draw (){
 background(255,0,0);
 translate(width/2, height/2);
 shape(bunny, 0, 0);
}

Rotating rocket
PShape bunny;

void setup(){
  size(800,800,P3D);
  bunny=loadShape("rocket.obj");
}
void draw(){
  background(255,0,0);
  lights();
  translate(width/2,height/2);
  rotateX(radians(mouseY));
  rotateY(radians(mouseX));
  shape(bunny,0,0);
}




Rotating bunny
PShape bunny;

void setup(){
  size(400,400,P3D);
  bunny=loadShape("bunny.obj");
}
void draw(){
  background(0,255,0);
  lights();
  translate(width/2,height/2);
  rotateX(radians(mouseY));
  rotateY(radians(mouseX));
  scale(50,50,50);//picture size
  shape(bunny,0,0);
}





20161229 小楓兒筆記

*3D掃描技術

Voxxlr
http://www.voxxlr.com/

Project Tango Test in my Roomhttps://www.youtube.com/watch?v=PMou8eIRzMk

kinectfusion

ToF Camera Noise of Kinect for Windows Ver.2.0





Q: 那戶外大型建築怎麼掃描?
A: 義大利有許多大型的雕像,可能5-10公尺高, "數位米開朗基羅計畫" 由跨國的團隊,把大型的雕像掃描起來。



scanning the David 











Low-Cost Multi-touch Whiteboard using the Wiimote



*Binvox

Tutorial Tuesday: Binvox

Binvox

2. 開啟cmd
3. 將下載的檔案拉到cmd
4. 下載Stanford bunny
5. 將bunny檔拉到cmd
6. 下載 viewvox







*做火箭

先開啟火箭範例
文件(file)→範例程序(example)→Basic/Shape/LoadDisplayOBJ→ctrl+K→把data裡的三個檔案拉到檔案裡(rocket.mtl、rocket.obj、rocket)



PShape bunny;

void setup(){
  size(400,400,P3D);
  bunny=loadShape("rocket.obj");
}
void draw(){
  background(255,0,0);
  translate(width/2,height/2);
  shape(bunny,0,0);
}




旋轉火箭

可以跟著滑鼠做旋轉




PShape bunny;

void setup(){
  size(400,400,P3D);
  bunny=loadShape("rocket.obj");
}
void draw(){
  background(255,0,0);
  lights();
  translate(width/2,height/2);
  rotateX(radians(mouseY));
  rotateY(radians(mouseX));
  shape(bunny,0,0);
}






兔子




PShape bunny;

void setup(){
  size(400,400,P3D);
  bunny=loadShape("bunny.obj");
}
void draw(){
  background(255,0,0);
  lights();
  translate(width/2,height/2);
  rotateX(radians(mouseY));
  rotateY(radians(mouseX));
  scale(50,50,50);//picture size
  shape(bunny,0,0);
}

Week 16 Sean's note 60408027E

3D 掃瞄器(掃點):


ToF Camera for Kinect (2014)


Models - Mobile 3d Laser Scanner (2013)


Scan David 數位米開朗基羅計畫 (1999)

Johnny Lee Wii Remote 電子白板(韓國電腦科學家)


binvox




似乎是作業系統的更新所以無法開啟,加裝 XQuartz
仍然無法開啟... 尋找替代方案

Processing:

int xRes,yRes,zRes, bunny[][][], inside[][][], millis0;
float angleX=0, angleY=0, myScale=1;
void setup(){
  size(600,400,P3D);
  byte b[]=loadBytes("bunny40.mira");//("bunny80.mira");
  xRes=((b[8] &0x00FF)<<8)+(b[9] &0x00FF);
  yRes=((b[10]&0x00FF)<<8)+(b[11]&0x00FF);
  zRes=((b[12]&0x00FF)<<8)+(b[13]&0x00FF);
  myScale=0.3*width/float(xRes);
  bunny=new int[xRes][yRes][zRes]; inside=new int[xRes][yRes][zRes];
  for(int i=0;i<xRes*yRes*zRes;i++){
    int x=int(i/(yRes*zRes)), y=int(i/zRes)%yRes, z=i%zRes;
    bunny[x][y][z]=b[256+(xRes+yRes+zRes)*8+i];
  }
  for(int i=1;i<xRes-1;i++)
    for(int j=1;j<yRes-1;j++)
      for(int k=1;k<zRes-1;k++)
        if(bunny[i-1][j][k]!=0 && bunny[i+1][j][k]!=0 && bunny[i][j-1][k]!=0 && bunny[i][j+1][k]!=0
            && bunny[i][j][k-1]!=0 && bunny[i][j][k+1]!=0) inside[i][j][k]=1;
}
void draw(){
  println("fps: "+frameRate);
  background(128); noStroke();
  pointLight(128,255,128, width, height, height);
  directionalLight(30,30,30, 0,0,-1);
  directionalLight(40,40,40, 0,1,-1); 
  translate(width/2,height/2,0);
  rotateX(-angleY);
  rotateY(angleX);
  rotateX(PI/2);
  scale(myScale);
  translate(-xRes,-yRes,-zRes);
  for(int i=0;i<xRes;i++){
    for(int j=0;j<yRes;j++){
      for(int k=0;k<zRes;k++){
        if(bunny[i][j][k]!=0 && inside[i][j][k]==0){
          pushMatrix();
          translate(2*i,2*j,2*k);
          box(2);
          popMatrix();
        }
      }
    }
  }
}
void mouseDragged(){
  angleX+=0.01*(mouseX-pmouseX);
  angleY+=0.01*(mouseY-pmouseY);
}



PShape rocket;

void setup(){
  size(400,400,P3D);
  rocket = loadShape("rocket.obj");
}

void draw(){
  background(255);
  translate(width/2, height/2);
  shape(rocket, 0, 0);
  println(frameCount);
}


PShape rocket;

void setup(){
  size(400,400,P3D);
  rocket = loadShape("rocket.obj");
}

void draw(){
  background(111,111,111);
  lights();
  translate(width/2, height/2);
  rotateZ(PI);
  rotateY(radians(mouseY));
  rotateX(radians(mouseX));  
  shape(rocket, 0, 0);
  println(frameCount);
}


PShape rocket;

void setup(){
  size(400,400,P3D);
  rocket = loadShape("bunny.obj");
}

void draw(){
  background(255,255,0);
  lights();
  translate(width/2, height/2);
  rotateZ(PI);
  rotateY(radians(mouseY));
  rotateX(radians(mouseX));
  scale(100);
  shape(rocket, 0, 0);
  println(frameCount);
}

兔子小尾巴