(2)Texture.exe
(3)實作:OpenCV
(4)實作:OpenCV+OpenGL貼圖
打開 windows:texture.exe
#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();
}
強勢衝擊白金
回覆刪除