Week07 Texture貼圖
step01
先到 https://jsyeh.org/3dcg10/ 下載
下載data跟win32,解壓縮後將data資料夾拉到win32裡面
(windows.zip 下載 \ windows \ Texture.exe)
(data.zip 下載 \ windows \ data)
step02
打開Texture.exe檔案,調整參數觀察看看 glColor4f()
glTexCoord2f(tx,ty); 貼圖座標
左邊是貼圖座標 右邊是頂點
切換貼圖的矩陣Matrix,這時候glTranslatef()、glRotatef()、glScale()就會套用到座標計算裡
Step03
打開OpenCV-2.1.0-win32-vs2008.exe ,第二步AddPath一定要設(點第二個或第三個都可以),
用原來的目錄C的OpenCV2.1目錄
step04
打開CodeBlock
Setting-Compiler 有三個步驟要做
Search directories 搜尋的目錄
- Compiler : include
- linker : lib
Linker setting
- cv210
- cxcore210
- highgui210
新增Empty file 在桌面新增資料夾week07
#include <opencv/highgui.h>
int main()
{
IplImage * img = cvLoadImage("image.jpg");
cvShowImage("week07",img);
cvWaitKey(0);
}
step06
到老師的GitHub去複製程式碼http://gist.github.com/jsyeh
step07
執行程式碼
step08
接著修改程式碼
按照逆時針的方向寫頂點會發現上下顛倒了
step09
建立一個新專案 去複製myearth.cpp的程式碼並修改圖檔名稱
執行他 球就會轉動了
step10
上傳檔案git指令
1. git指令
2. cd desktop
3. git clone https://github.com/你的帳號/2023graphicsa
4. cd 2023graphicsa
5. start .
6. git add .
7. git status
8. git config --global user.email "電子郵件"
9. git config --global user.name "帳號名chiche0306"
10. git commit -m "week"
11. git push



















沒有留言:
張貼留言