1.參考網址:http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/
並下載:[source][data][win32][glut32.dll]

2.並將下載的檔案拉進資料夾

課堂作業二:
1.開新的專案和新增新的程式
2.增加新連結
3.增加新連結
4.增加新程式
5.複製檔案貼入專案中
課堂作業三:
Step 2. 程式碼如下 :
#include "glm.h"GLMmodel *pmodel = NULL;void display (){glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);if (!pmodel){pmodel = glmReadOBJ("data/porsche.obj");if (!pmodel) exit (0);glmUnitize(pmodel) ;glmFacetNormals(pmodel);glmVertexNormals(pmodel,90.0);}glmDraw(pmodel,GLM_SMOOTH| GLM_MATERIAL);glutSwapBuffers();}GLfloat pos[] = {0.0 , 0.0,-1.0,0.0};int main (int argc ,char **argv){glutInit (&argc,argv);glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);glutCreateWindow ("3D Model");glutDisplayFunc (display);glLightfv (GL_LIGHT0,GL_POSITION,pos);glEnable (GL_LIGHT0);glEnable (GL_LIGHTING);glEnable (GL_DEPTH_TEST);glutMainLoop();}
Step 3 執行

沒有留言:
張貼留言