2019年4月11日 星期四

*~~~~~~~~*

主題1:
1.貼圖 Texture
先登入小葉的網站,下載3個東西
data win32 glut32.dll
2.
把data跟glut加入windows資料夾
3.
開啟Texture











主題2:
1.
下載opencv2.1 要Add PATh
資料夾放在c:\opencv2.1
2.
打入程式碼
#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();
}
3.
要build

加入

加入

加入

4.
把earth.jpg放入Freeglut的bin











5.
執行結果

沒有留言:

張貼留言