#OBJ裡有3個重要英文單字縮寫
1.V代表vertex頂點
2.VN代表vertex normal和打光相關的頂點法向量
3.F代表face(有人會拼成facet比較小的面)
-解釋:3dxMax習慣叫triangles三角形,執行時快又有效率
在Maya等動畫軟體裡,習慣用face(有三角形 四邊形 五邊形)
其他:usemtl xxx 使用 materail xxx
其他:g xxx 代表group xxx 分群組用的
其他:mtllib Gundam.mtl 有另一個檔案叫Gundam.mtl 裡面有一堆 mtl
#研究Gundam的模型
-Gundam.obj 現在要開啟這個檔案
Gundam.mtl
Diffuse.jpg 是主要的material 材質貼圖
#week07-1_obj_gundam
先將source.zip的glm.h和glm.c解壓縮再把glm.c改成glm.cpp
1.File-New-Project, GLUT專案week07_1_obj_gundam
2.將glm.h和glm.cpp放入week07_1_obj_gundam同一個目錄
3.Codeblocks的week07_1_obj_gundam專案案右鍵把glm.cpp加入
4.11行程式放進來
5.把glm使用需要的3段程式放進
6.專案按右鍵最下面的properties
7.小數點 . 代表現在專案的目錄
8.freeglut/bin/freeglut.dll放進week07-1_obj_gundam目錄
9.Gundam.obj Gundam.mtl 放進 week07-1_obj_gundam 目錄
#week07-2_obj_gundam_opencv_texture
#week07-3_obj_gundam_opencv_texture
設定好OpenCV 安裝 OpenCV-2.1, 要加PATH,用預設目錄
1.設定貼圖的3個設定 Setting-Compiler
1.1.在Search directories 加入2個目錄
Compiler 加入 C:\OpenCV2.1\include
Linker 加入C:\OpenCV2.1\lib
Linker setting 裡,加入3個 cv210 cxcore210 highgui210
2.GLUT專案week07-2_obj_gundam_opencv_texture
3.把glm.cpp glm.h freeglut.dll Gundam.obj Gundam.mtl放入目錄
4.Add files加入glm.cpp 再把Diffuse.jpg也放進去
5.貼入week07-1的程式碼
glutMainLoop()之前,也要加入myTexture("Diffuse.jpg");
最後前面加入myTexture 對應的18行程式


沒有留言:
張貼留言