2019年4月11日 星期四

老灰灰得思覺失調電腦圖學

http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/?fbclid=IwAR0nBxHkxDgzPvjqcNpix2VmbogCHUlASKg02sVtsvsVoVbIid4iYS096F4
下載 data windows32 dll檔案
主題:貼圖
範例:texture.exe
實作:openCV
實作:opencv+openGL貼圖
期中考:10行openGL程式
GOOGLE搜尋 OPENcv2.1下載 安裝 
然後一樣下載FREEGLUT作跟之前一樣動作 解壓縮後 複製改名字
接下來就可以開起專案GLUT

打入程式碼
#include <GL/glut.h>
#include <opencv/highgui.h>///貼圖需要
void display()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glutSolidTeapot( 0.3 );
    glutSwapBuffers();
}
int main(int argc, char**argv)
{
    IplImage * img=cvLoadImage("light.jpg");///貼圖需要
    cvShowImage("opencv Window", img);///貼圖需要
    cvWaitKey(0);///貼圖需要

    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE |GLUT_DEPTH);
    glutCreateWindow("Week08");

    glutDisplayFunc(display);

    glutMainLoop();
}
右鍵檔案 build option _search dirction_compiler_add _include那裏 
                                                                  linker _add_lib那個

link setting_ cv210
                      cxcore210
                      highgui210


沒有留言:

張貼留言