2020年5月5日 星期二

week10

http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/這個網址下載data,source,win32,glut.dll
到source裡的glm.c,glm.h,translation.c移動到codeblacks的檔案裡並將glm.c改為glm.cpp
然後data季的丟進freeglut資料夾裡
#include <GL\glut.h>
#include "glm.h"
GLMmodel * model=NULL;
void display()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    if(model==NULL)
    {
        model = glmReadOBJ("data/Al.obj");
        glmUnitize(model);
        glmFacetNormals(model);
        glmVertexNormals(model,90);
    }
    glmDraw(model,GLM_SMOOTH | GLM_MATERIAL);
    glutSwapBuffers();
}
int main(int argc, char**argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("week11!!!");

    glutDisplayFunc(display);

    glutMainLoop();
}

沒有留言:

張貼留言