windows.zip -->desktop\windows\transformation.exe
data.zip --> desktop\windows\data\soccerball.obj
glut32.dll --> desktop\windows\glut32.dll
freeglut 要拉出來
freeglut 要拉出來
(1) 切換模型
(2)開啟soccervall.obj /.mtl ;
v開頭 vertex ;
vn開頭 vertex normall ;
vt 開頭 vertex texture coordinate;
f 開頭 face 臉面;
執行結果
老師教的
程式碼:
#include <string.h>
#include <GL/glut.>
#inlcude "glm.h"
GLMmodel* pmodel = NULL;
void dispaly()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUTTER_BIT );
if (!pmodel) {
pmodel = glmReadOBJ("data/porsche.obj");
if(!pmodel) exit(0);
glmUnitize(pmodel);
glmFaceNotmals(pmodel);
glmVertexNotmal(pmodel,90.0);
}
glmDraw(pmodel,GLM_SMOOTH | GLM_MATERIAL);
glutSwapBuffers();
}
int main (int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDispalyMode(GLUT_DOUBLE | GLUT_DWPTH_BIT | GLUT_RGB) ;
glutCreateWindow("Here is #D show!!");
glutDispalyFunc();
}
截圖說明: 程式碼
程式碼:
#include <string.h>
#include <GL/glut.>
#inlcude "glm.h"
GLMmodel* pmodel = NULL;
void dispaly()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUTTER_BIT );
if (!pmodel) {
pmodel = glmReadOBJ("data/porsche.obj");
if(!pmodel) exit(0);
glmUnitize(pmodel);
glmFaceNotmals(pmodel);
glmVertexNotmal(pmodel,90.0);
}
glmDraw(pmodel,GLM_SMOOTH | GLM_MATERIAL);
glutSwapBuffers();
}
int main (int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDispalyMode(GLUT_DOUBLE | GLUT_DWPTH_BIT | GLUT_RGB) ;
glutCreateWindow("Here is #D show!!");
glutDispalyFunc();
}
截圖說明: 程式碼
沒有留言:
張貼留言