資源簡介
根據Nehe陰影改寫,obj模型顯示陰影。
代碼片段和文件信息
/*
??????glm.cpp
??????Wavefront?OBJ?model?file?format?reader/writer/manipulator.
??????Includes?routines?for?generating?smooth?normals?with
??????preservation?of?edges?welding?redundant?vertices?&?texture
??????coordinate?generation?(spheremap?and?planar?projections)?+?more.
*/
#include?
#include?
#include?
#include?
#include?
#include?“glm.h“
#define?T(x)?(model->triangles[(x)])
#define?fsin(x)?(float)sin(x)
#define?fcos(x)?(float)cos(x)
#define?fasin(x)?(float)asin(x)
#define?facos(x)?(float)acos(x)
#define?fsqrt(x)?(float)sqrt(x)
/*?_GLMnode:?general?purpose?node
?*/
typedef?struct?_GLMnode?{
??GLuint???????????index;
??GLboolean????????averaged;
??struct?_GLMnode*?next;
}?GLMnode;
/*?glmMax:?returns?the?maximum?of?two?floats?*/
static?GLfloat?glmMax(GLfloat?a?GLfloat?b)?
{
??if?(b?>?a)
????return?b;
??return?a;
}
/*?glmAbs:?returns?the?absolute?value?of?a?float?*/
static?GLfloat?glmAbs(G
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????878??2009-12-30?22:17??27_Shadow\27_Shadow.sln
????..A..H.?????17408??2010-01-31?22:26??27_Shadow\27_Shadow.suo
?????文件???????4546??2010-01-03?21:41??27_Shadow\27_Shadow.vcproj
?????文件???????7067??2010-01-03?21:54??27_Shadow\3Dob
?????文件????????651??2010-01-03?20:15??27_Shadow\Data\ddd.txt
?????文件????????403??2000-05-04?11:55??27_Shadow\Data\ob
?????文件????????902??2000-05-05?02:11??27_Shadow\Data\ob
?????文件???????1374??2000-05-05?02:16??27_Shadow\Data\ob
?????文件?????????82??2000-05-18?02:04??27_Shadow\Data\Simpleob
?????文件??????12024??2005-10-19?15:32??27_Shadow\GLAUX.H
?????文件????1312394??2005-10-19?15:32??27_Shadow\GLAUX.LIB
?????文件?????474288??2006-03-04?03:19??27_Shadow\glew.h
?????文件?????281360??2006-03-04?03:19??27_Shadow\glew32.lib
?????文件??????52502??2010-01-31?22:25??27_Shadow\glm.cpp
?????文件???????8422??2010-01-03?21:43??27_Shadow\glm.h
?????文件??????12672??2002-08-09?23:09??27_Shadow\GlU32.Lib
?????文件??????21440??1998-08-18?23:24??27_Shadow\glut.h
?????文件??????79898??1998-08-18?23:25??27_Shadow\glut32.lib
?????文件????????377??2010-01-31?22:24??27_Shadow\ModelView.cpp
?????文件????????334??2010-01-03?19:51??27_Shadow\ModelView.h
?????文件??????76924??2002-08-09?23:10??27_Shadow\OpenGL32.Lib
?????文件??????25380??2010-01-31?22:04??27_Shadow\Shadow.cpp
?????文件??????39310??2006-03-04?03:19??27_Shadow\wglew.h
?????目錄??????????0??2010-01-19?19:25??27_Shadow\Data
?????目錄??????????0??2010-01-31?22:27??27_Shadow
-----------?---------??----------?-----??----
??????????????2430636????????????????????25
評論
共有 條評論