2023年3月30日 星期四

91 week07

 到https://jsyeh.org/3dcg10/ 下載解壓縮 data win 打開Texture.exe

調整顏色:


調整四個頂點:
repet超過的話從0開始:

考試練習:
https://jsyeh.org/gl/opengl_10_func.html
opengl 10行程式碼
安裝opencv,葉老師上課資料夾,勾下面兩個選項:

先Search在Linker:
Search:compiler,linker


week07-1:
程式碼:
#include <opencv/highgui.h>
int main()
{
    IplImage*img=cvLoadImage("a.jpg");///檔名
    cvShowImage("week07",img);
    cvWaitKey(0);
}
圖片存桌面,檔案也是
注意要存成.cpp檔,不是.c檔
顯示圖片:
到:https://gist.github.com/jsyeh/
找到程式碼:mytexture_sample.cpp
複製貼上codeblocks opengl新專案
下載圖片earth.jpg
存在freegult bin裡面:
增加程式碼在21跟28行之間:
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();
week07-2myearth:
再開一個新專案
再到:https://gist.github.com/jsyeh/  
找到程式碼:
myEarth.cpp 複製貼上
把week10改成week07和earth.jpg。

















沒有留言:

張貼留言