1.主題:貼圖Texture
2.範例:Texture.exe
3.實作:OpenCV
4.實作:OpenCV+OpenGL貼圖
5.期中考:10行OpenGL程式
6.跟前幾次一樣下載win32,data,glut.dll
7.今天要教的是Texture以下是圖片
8.打開codeblocks打
#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("naruto.jpg");
cvShowImage("opencv Window",img);
cvWaitKey(0);
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("06160396-week08");
glutDisplayFunc(display);
glutMainLoop();
}
7.今天要教的是Texture以下是圖片
8.打開codeblocks打
#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("naruto.jpg");
cvShowImage("opencv Window",img);
cvWaitKey(0);
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("06160396-week08");
glutDisplayFunc(display);
glutMainLoop();
}
會出現以下圖片
9.以下是會出現圖片的步驟
10先找一張圖片到freeglut資料夾的bin
11.用codeblocks點選標題右鍵的build_option
12.去複製網址貼到裡面
沒有留言:
張貼留言