資源簡(jiǎn)介
圖形學(xué)試驗(yàn),三維迷宮
代碼片段和文件信息
/*/
//?????????????????MD2?Viewer?(c)?1999?by?Mete?Ciragan
//
//?file:???????????md2.c
//?last?modified:??Apr?28?1999?Mete?Ciragan
//?copyright:??????The?programs?and?associated?files?contained?in?this
//?????????????????distribution?were?developed?by?Mete?Ciragan.?The?programs
//?????????????????are?not?in?the?public?domain?but?they?are?freely
//?????????????????distributable?without?licensing?fees.?These?programs?are
//?????????????????provided?without?guarantee?or?warrantee?expressed?or
//?????????????????implied.
//
//?version:????????1.4
//
//?email:??????????mete@swissquake.ch
//?web:????????????http://www.swissquake.ch/chumbalum-soft/
/*/
#include?“StdAfx.h“
#include?
#include?
#include??/*?memset?*/
#include??/*?sqrt?*/
//#include?
#include?
#include?
#include?“md2.h“
#define?NUMVERTEXNORMALS?162
float?avertexnormals[NUMVERTEXNORMALS][3]?=?{
#include?“anorms.h“
};
static?int?g_glcmds?=?1;?/*?use?glcommands?*/
static?int?g_interp?=?1;?/*?interpolate?frames?*/
/*
?*?load?model
?*/
md2_model_t*
md2_readModel?(const?char?*filename)
{
FILE?*file;
md2_model_t?*model;
byte?buffer[MD2_MAX_frameSIZE];
int?i;
model?=?(md2_model_t?*)?malloc?(sizeof?(md2_model_t));
if?(!model)
return?0;
file?=?fopen?(filename?“rb“);
if?(!file)
{
free?(model);
return?0;
}
/*?initialize?model?and?read?header?*/
memset?(model?0?sizeof?(md2_model_t));
fread?(&model->header?sizeof?(md2_header_t)?1?file);
#if?0
printf?(“magic:\t\t%d\n“?model->header.magic);
printf?(“version:\t\t%d\n“?model->header.version);
printf?(“skinWidth:\t\t%d\n“?model->header.skinWidth);
printf?(“skinHeight:\t\t%d\n“?model->header.skinHeight);
printf?(“frameSize:\t\t%d\n“?model->header.frameSize);
printf?(“numSkins:\t\t%d\n“?model->header.numSkins);
printf?(“numVertices:\t\t%d\n“?model->header.numVertices);
printf?(“numTexCoords:\t\t%d\n“?model->header.numTexCoords);
printf?(“numTriangles:\t\t%d\n“?model->header.numTriangles);
printf?(“numGlCommands:\t\t%d\n“?model->header.numGlCommands);
printf?(“numframes:\t\t%d\n“?model->header.numframes);
printf?(“offsetSkins:\t\t%d\n“?model->header.offsetSkins);
printf?(“offsetTexCoords:\t%d\n“?model->header.offsetTexCoords);
printf?(“offsetTriangles:\t%d\n“?model->header.offsetTriangles);
printf?(“offsetframes:\t\t%d\n“?model->header.offsetframes);
printf?(“offsetGlCommands:\t%d\n“?model->header.offsetGlCommands);
printf?(“offsetEnd:\t\t%d\n“?model->header.offsetEnd);
#endif
if?(model->header.magic?!=?(int)?((‘2‘?<24)?+?(‘P‘?<16)?+?(‘D‘?<8)?+?‘I‘))
{
fclose?(file);
free?(model);
return?0;
}
/*?read?skins?*/
fseek?(file?model->header.offsetSkins?SEEK_SET);
if?(model->header.numSkins?>?0)
{
model->skins?=?(md2_skin_t?*)?malloc?(sizeof?(md2_skin_t)?*?model->header.numSkins);
if?(!model->skins)
{
md2_freeM
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2016-06-02?20:26??實(shí)驗(yàn)2+陳彩娟+201300130003\
?????目錄???????????0??2016-06-02?20:19??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\
?????目錄???????????0??2016-06-02?20:19??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\
?????文件???????61678??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\CL.read.1.tlog
?????文件????????3136??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\CL.write.1.tlog
?????文件??????169472??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.exe
?????文件?????????406??2012-12-12?20:42??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.exe.em
?????文件?????????472??2012-12-12?20:42??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.exe.em
?????文件?????????381??2012-12-21?15:40??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.exe.intermediate.manifest
?????文件?????1593764??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.ilk
?????文件?????????115??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.lastbuildstate
?????文件????????3273??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.log
?????文件??????264099??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.obj
?????文件?????1179648??2016-05-03?10:18??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.pch
?????文件?????1436672??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3.pdb
?????文件?????????210??2012-12-12?20:42??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\OpenGLexp3_manifest.rc
?????文件????????7406??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\cl.command.1.tlog
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
?????文件???????????2??2016-05-12?09:58??實(shí)驗(yàn)2+陳彩娟+201300130003\代碼\Debug\li
............此處省略207個(gè)文件信息
評(píng)論
共有 條評(píng)論