2015年5月13日 星期三

02160366 武鵬宇 week12

#include "glm.h"
GLMmodel* pmodel = NULL;

void display()
{
    GLfloat pos[] ={0.0,0.0,-1.0,0.0};
    glLightfv(GL_LIGHT0,GL_POSITION,pos);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);

    glEnable(GL_DEPTH_TEST);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glmDraw(pmodel, GLM_SMOOTH | GLM_MATERIAL);
    glFlush();
}
int main(int argc, char** argv)
{

    pmodel = glmReadOBJ("porsche.obj");
    glmUnitize(pmodel);
glmFacetNormals(pmodel);
glmVertexNormals(pmodel, 90.0);

glutInit(&argc,argv);
glutCreateWindow("3D");
glutDisplayFunc(display);
glutMainLoop();
}



沒有留言:

張貼留言