亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? load3ds.h

?? 多個3ds載入例子運行的時候有些慢候有些慢候有些慢
?? H
字號:
// Load3DS.h: interface for the CLoad3DS class.
//     原始代碼來自:GameTutorials
//     改編:
//     沈陽藍雨視景科技
//     http://www.bvrain.com
//     bvrain@163.com  chglei@163.com
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LOAD3DS_H__69E7E7AC_7A07_4479_9687_AC19CED0E3CF__INCLUDED_)
#define AFX_LOAD3DS_H__69E7E7AC_7A07_4479_9687_AC19CED0E3CF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "3dmath.h"
//向量STL
#include <vector>
using namespace std;

//>------ Primary Chunk, at the beginning of each file
#define PRIMARY       0x4D4D

//>------ Main Chunks
#define OBJECTINFO    0x3D3D				// This gives the version of the mesh and is found right before the material and object information
#define VERSION       0x0002				// This gives the version of the .3ds file
#define EDITKEYFRAME  0xB000				// This is the header for all of the key frame info

//>------ sub defines of OBJECTINFO
#define MATERIAL	  0xAFFF				// This stored the texture info
#define OBJECT		  0x4000				// This stores the faces, vertices, etc...

//>------ sub defines of MATERIAL
#define MATNAME       0xA000				// This holds the material name
#define MATDIFFUSE    0xA020				// This holds the color of the object/material
#define MATMAP        0xA200				// This is a header for a new material
#define MATMAPFILE    0xA300				// This holds the file name of the texture

//********************** 新增加標志 ***********************
#define  MAT_AMBIENT  0xA010
#define  MAT_SPECULAR 0xA030
#define  MAT_EMISSIVE 0xA040
//********************** 新增加標志 ***********************

#define OBJECT_MESH   0x4100				// This lets us know that we are reading a new object

//>------ sub defines of OBJECT_MESH
#define OBJECT_VERTICES     0x4110			// The objects vertices
#define OBJECT_FACES		0x4120			// The objects faces
#define OBJECT_MATERIAL		0x4130			// This is found if the object has a material, either texture map or color
#define OBJECT_UV			0x4140			// The UV texture coordinates


// 加載3DS文件類
class CLoad3DS
{
//把這幾個結構體聲明到類里面,使封裝更徹底
public:
	// Here is our structure for our 3DS indicies (since .3DS stores 4 unsigned shorts)
	struct tIndices {							

		unsigned short a, b, c, bVisible;		// This will hold point1, 2, and 3 index's into the vertex array plus a visible flag
	};

	// This holds the chunk info
	struct tChunk
	{
		unsigned short int ID;					// The chunk's ID		
		unsigned int length;					// The length of the chunk
		unsigned int bytesRead;					// The amount of bytes read within that chunk
	};

	// This is our face structure.  This is is used for indexing into the vertex	
	// and texture coordinate arrays.  From this information we know which vertices
	// from our vertex array go to which face, along with the correct texture coordinates.
	struct tFace
	{
		int vertIndex[3];			// indicies for the verts that make up this triangle
		int coordIndex[3];			// indicies for the tex coords to texture this face
	};

	//材料信息類
	struct tMaterialInfo
	{
		char  strName[255];			// The texture name
		char  strFile[255];			// The texture file name (If this is set it's a texture map)
		
		BYTE  color[3];				// The color of the object (R, G, B)
		//添加以下四個元素
		float   ambient[4];				// 泛光
		float  diffuse[4];				// 散光
		float  specular[4];				// 反光
		float  emissive[4];				// 發光(一般為0,0,0,1)
		
		int   texureId;				// the texture ID
		float uTile;				// u tiling of texture  (Currently not used)
		float vTile;				// v tiling of texture	(Currently not used)
		float uOffset;			    // u offset of texture	(Currently not used)
		float vOffset;				// v offset of texture	(Currently not used)
	} ;
	//材料引用類
	class tMatREF
	{
	public:
		int nMaterialID;
		USHORT *pFaceIndexs;
		int nFaceNum;
		bool bHasTexture;
	public:
		tMatREF()
		{
			nMaterialID=-1;
			nFaceNum=0;
			pFaceIndexs=NULL;
			bHasTexture=false;
		}
	};

	// This holds all the information for our model/scene. 
	// You should eventually turn into a robust class that 
	// has loading/drawing/querying functions like:
	struct t3DObject 
	{
		int  numOfVerts;			// The number of verts in the model
		int  numOfFaces;			// The number of faces in the model
		int  numTexVertex;			// The number of texture coordinates
		int  numOfMaterials;		// the 材料數量
		int  materialID;			// The texture ID to use, which is the index into our texture array
		bool bHasTexture;			// This is TRUE if there is a texture map for this object
		char strName[255];			// The name of the object
		CVector3  *pVerts;			// The object's vertices
		CVector3  *pNormals;		// The object's normals
		CVector2  *pTexVerts;		// The texture's UV coordinates
		tFace *pFaces;				// The faces information of the object
		tMatREF	      *pMaterialREFS;// 材料IDS
		
	};

	// This holds our model information.  This should also turn into a robust class.
	// We use STL's (Standard Template Library) vector class to ease our link list burdens. :)
	struct t3DModel 
	{
		int numOfObjects;					// The number of objects in the model
		int numOfMaterials;					// The number of materials for the model
		//改名了	
		vector<tMaterialInfo> vctMaterials;	// The list of material information (Textures and colors)
		vector<t3DObject> vctObjects;			// The object list for our model
	};

public:
	void Bytes2Floats(BYTE *pbs,float *pfs,int num,float fsk);
	//構造
	CLoad3DS();								
	//析構
	~CLoad3DS();
	// 載入3ds文件
	bool Import3DS(t3DModel *pModel, char *strFileName);

private:
	// This reads in a string and saves it in the char array passed in
	int GetString(char *);

	// This reads the next chunk
	void ReadChunk(tChunk *);

	// This reads the next large chunk
	void ProcessNextChunk(t3DModel *pModel, tChunk *);

	// This reads the object chunks
	void ProcessNextObjectChunk(t3DModel *pModel, t3DObject *pObject, tChunk *);

	// This reads the material chunks
	void ProcessNextMaterialChunk(t3DModel *pModel, tChunk *);

	// This reads the RGB value for the object's color
	// 改造了,添加了一個標志
	void ReadColorChunk(tMaterialInfo *pMaterial, tChunk *pChunk,USHORT typeFlag=0);

	// This reads the objects vertices
	void ReadVertices(t3DObject *pObject, tChunk *);

	// This reads the objects face information
	void ReadVertexIndices(t3DObject *pObject, tChunk *);

	// This reads the texture coodinates of the object
	void ReadUVCoordinates(t3DObject *pObject, tChunk *);

	// This reads in the material name assigned to the object and sets the materialID
	void ReadObjectMaterial(t3DModel *pModel, t3DObject *pObject, tChunk *pPreviousChunk,vector<tMatREF*> *pvmatids);
	
	// This computes the vertex normals for the object (used for lighting)
	void ComputeNormals(t3DModel *pModel);

	// This frees memory and closes the file
	void CleanUp();
	
	// The file pointer
	FILE *m_FilePointer;
};


#endif // !defined(AFX_LOAD3DS_H__69E7E7AC_7A07_4479_9687_AC19CED0E3CF__INCLUDED_)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区91| 亚洲人亚洲人成电影网站色| 欧美日韩精品欧美日韩精品一| 不卡的电影网站| av电影天堂一区二区在线| 成人av在线一区二区| av不卡免费电影| 色婷婷av一区二区三区gif| 色网站国产精品| 色婷婷激情久久| 欧美日韩午夜精品| 日韩一区二区三| 欧美本精品男人aⅴ天堂| 久久影视一区二区| 久久久久久久av麻豆果冻| 久久久电影一区二区三区| 中文字幕高清一区| 亚洲精品乱码久久久久久日本蜜臀| 一区二区三区久久久| 午夜视频一区在线观看| 美女视频黄 久久| 国产精品996| 91美女在线视频| 欧美精品色综合| 精品少妇一区二区三区视频免付费 | 91精品国产91综合久久蜜臀| 精品国偷自产国产一区| 欧美激情综合网| 一区二区三区中文在线| 日韩成人免费在线| 国产精品资源在线看| 91蜜桃视频在线| 在线不卡的av| 国产日韩精品一区| 一区二区三区成人| 久久国产精品免费| 99re这里都是精品| 3751色影院一区二区三区| 国产亚洲精品免费| 亚洲一区免费视频| 国产精品综合二区| 欧美亚洲动漫精品| 久久久精品2019中文字幕之3| 亚洲视频一区二区在线观看| 老司机精品视频导航| 99精品欧美一区二区三区小说| 欧美日韩电影在线| 中文字幕第一页久久| 日韩1区2区日韩1区2区| 成人教育av在线| 日韩欧美卡一卡二| 亚洲欧美一区二区三区久本道91 | 波多野结衣欧美| 欧美一级精品在线| 亚洲精品乱码久久久久久| 在线精品国精品国产尤物884a | 午夜精品一区在线观看| 国产不卡在线视频| 欧美一区二区福利在线| 亚洲欧美韩国综合色| 另类欧美日韩国产在线| 欧美性受极品xxxx喷水| 中文字幕av免费专区久久| 日本成人在线视频网站| 日本大香伊一区二区三区| 久久久久久99精品| 日韩国产高清在线| 色哟哟日韩精品| 国产精品久久久久一区二区三区 | 亚洲一区二区三区四区五区黄| 国产精品77777| 日韩精品中文字幕一区二区三区 | 亚洲人成小说网站色在线| 久久精品99久久久| 欧美综合在线视频| 国产精品久久一级| 国产精品一区二区三区99| 欧美一级视频精品观看| 午夜一区二区三区在线观看| 91免费观看在线| 国产精品国产三级国产aⅴ中文| 国产一区二区三区四区五区入口 | 欧美日韩成人高清| 国产精品成人网| 国产精品亚洲综合一区在线观看| 欧美一级日韩一级| 日韩精品电影在线观看| 欧美日韩激情一区二区| 亚洲综合一区二区精品导航| 色偷偷一区二区三区| 亚洲欧美偷拍卡通变态| 91视频www| 成人欧美一区二区三区视频网页 | 欧美国产一区视频在线观看| 黄页网站大全一区二区| 日韩欧美电影一区| 久久99久久99精品免视看婷婷 | 国产亚洲精久久久久久| 韩国成人在线视频| 久久综合色8888| 国产在线不卡一区| 国产三级一区二区三区| 狠狠色丁香久久婷婷综| 26uuu亚洲综合色欧美| 91影视在线播放| 亚洲精品久久嫩草网站秘色| 欧美专区亚洲专区| 亚洲国产一二三| 欧美日韩精品一区视频| 爽爽淫人综合网网站| 日韩欧美亚洲一区二区| 国产一区二区视频在线| 国产精品色噜噜| 色妹子一区二区| 亚洲成人动漫在线免费观看| 日韩一区二区三区在线观看| 国内精品伊人久久久久av影院| 国产午夜三级一区二区三| 99久久综合狠狠综合久久| 一区二区三区在线看| 欧美日韩免费观看一区三区| 免费观看30秒视频久久| 国产午夜精品福利| 91污在线观看| 天堂一区二区在线| 精品剧情v国产在线观看在线| 国产精品18久久久久久vr| 亚洲同性同志一二三专区| 欧美日韩国产一区| 捆绑调教一区二区三区| 国产精品美女久久久久久久久 | 欧美高清视频不卡网| 免费观看在线综合| 国产欧美一区二区三区在线看蜜臀 | 中国色在线观看另类| 色综合一个色综合亚洲| 天天色综合成人网| 久久久三级国产网站| 色婷婷av一区二区三区之一色屋| 日韩**一区毛片| 国产精品欧美久久久久一区二区| 日本韩国一区二区| 精品在线一区二区| 中文字幕亚洲电影| 欧美一区二区三区婷婷月色| 成人免费福利片| 亚洲v中文字幕| 国产精品五月天| 在线播放一区二区三区| 国产91在线看| 亚洲成人综合网站| 国产精品网曝门| 91精品国产一区二区三区| 成人不卡免费av| 老司机一区二区| 亚洲伊人伊色伊影伊综合网| 国产日韩欧美在线一区| 欧美日韩在线一区二区| 成人综合在线网站| 裸体在线国模精品偷拍| 亚洲欧美成aⅴ人在线观看| 亚洲精品在线观| 色香色香欲天天天影视综合网| 激情另类小说区图片区视频区| 亚洲成a人在线观看| 国产精品麻豆视频| 精品久久久久香蕉网| 欧美日本一区二区三区四区| 97久久久精品综合88久久| 国内精品写真在线观看| 午夜成人免费电影| 亚洲女厕所小便bbb| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美aaaaaa午夜精品| 亚洲四区在线观看| 久久久影院官网| 7777精品久久久大香线蕉| 91丨九色丨黑人外教| 成人一级片网址| 国产中文字幕一区| 日韩影院免费视频| 一区二区三区精品视频| 中文字幕日韩av资源站| 国产三级欧美三级日产三级99| 日韩欧美国产不卡| 91麻豆精品国产91久久久久| 91国产福利在线| 91老师国产黑色丝袜在线| 成人av片在线观看| 国产成人精品在线看| 国产精品99久久久久久宅男| 国内精品国产成人国产三级粉色| 日本一区中文字幕| 日韩精品91亚洲二区在线观看| 亚洲免费大片在线观看| 亚洲图片激情小说| 中文字幕亚洲欧美在线不卡| 国产精品久久久久影院亚瑟 | 婷婷综合在线观看| 亚洲成av人影院在线观看网|