(1)主題:貼圖Texture
(2)範例:Texture.exe
(3)實作:OpenCv
(4)實作:OpenCV+OpenGL貼圖
(5)期中考:10行程式碼
(2)範例:Texture.exe
(3)實作:OpenCv
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT);
glutSolidTeapot( 0.3 );
glutSwapBuffers();
}
int main(int argc, char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("week08!!");
glutDisplayFunc(display);
glutMainLoop();
}
#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();
}
沒有留言:
張貼留言