week 05
##OpenCV
1.安裝OpenCV 2.1(桌面)
2.記得安裝第三步,add OpenCV to system PATH
3.目錄不要改,用預設的 C:OpenCV2.1 不要動
4.檔案總管檢查 C:\ 多了 OpenCV2.1目錄 裡面有include有lib有bin三個好東西
5.關閉clodeblocks 再開,才會認識OpenCV
接下來要做codeblocks設定
1.setting-compiler setting,目錄compiler 要加入include目錄
C:\OpenCV2.1\include
2.setting-compiler setting,目錄linker 要加入lib目錄
C:\OpenCV2.1\lib
3.setting-compiler setting,linker setting要加入cv210 cxcore210 highgui210 3個檔名
要寫OpenCV的程式,只要在codeblocks新增空白檔案就好了
file-new-emptyfile空白檔案 05-1 opencv.cpp
請把一張圖
##課本範例
連上網站 jsyeh.org/3dcg10 下載 data win32
windows.zip=>
下載\windows\Ttexture.exe
data.zip=>
下載\windows\data\一堆圖檔
## week05-1_texture_opencv_cvLoadImage
0.安裝freeglut 到桌面,再把lib\libfreeglut.a複製成libglut32.a
1.file-new-project,GLUT專案, week05-1_texture_openc_cvLoadImage
2.貼上11行GLUT程式
3.貼上第一節課的3行程式
## week05-2_texture_teatop_earth
1.file-new-project,GLUT專案,week05-2_texture_teatop_earth
2.老師有個程式選好了,裡面有18行貼圖給我們用
## week05-3_texture_polygon
1.file-new-project,GLUT專案,week05-3_texture_polygon
2.把week05-2_texture_teatop_earth 貼來用
3.再加4行
glBegin(GL_POLYGON);
glTexCoord2f(0,0); glVertex2f(-1,-1);
glTexCoord2f(1,0); glVertex2f(+1,-1);
glTexCoord2f(1,1); glVertex2f(+1,+1);
glTexCoord2f(0,1); glVertex2f(-1,+1);
glEnd();
## week05-4_texture_earth_rotating
沒有留言:
張貼留言