2023年3月29日 星期三

Y7



 把Texture檔案下載&打開

 

glColor3f () ->> 幾個f就會有幾個參數

貼圖顏色的色彩會被混合到





在人類世界經常是四邊型

在3d圖學世界經常是三邊型



第十周期中考

OpenCV-2.1.0-win32-vs2008.exe
(設定ADD PATH(二或三都可


Codeblocks->>Setting->>Compiler->>Search direction


ADD三個咒語:
1.Compiler->>C:\OpenCV2.1\include
2.Linker->>C:\OpenCV2.1\lib
3.Linker Setting-->1.cv210 
                               2.cxcore210 
                               3.highgui210



#include <opencv/highgui.h>

int main()
{
    IplImage * img = cvLoadImage("image.jpg");
    cvShowImage("week07",img);
    cvWaitKey(0);
}


貼圖要放在正確的位置

image.jpg(隨便找一張電影海報)-->新創的資料夾week07
earth.jpg(隨便找一張地球圖片)-->>桌面的freeglut的bin目錄裡面

去教授的網址複製程式碼放到Codeblocks


22行-->

{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_POLYGON)
   glTextCoord2f(0,0); glVertex2f(-1, +1);
   glTextCoord2f(1,0); glVertex2f(+1, +1);
   glTextCoord2f(1,1); glVertex2f(+1, -1);
   glTextCoord2f(0,1); glVertex2f(-1, =1);
glEnd();
glutSwapBuffers();
)



myTexture("earth.jpg");











































沒有留言:

張貼留言