2019年4月11日 星期四

鄭勛文 Week08

(1)主題:貼圖Texture
(2)Texture.exe
(3)實作:OpenCV
(4)實作:OpenCV+OpenGL貼圖

打開 windows:texture.exe


Texture貼圖

#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("earth.jpg");
    cvShowImage("opencv Window",img);
    cvWaitKey(0);

    glutInit(&argc,argv);

    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);

    glutCreateWindow("week08");

    glutDisplayFunc(display);

    glutMainLoop();

}

1 則留言: