00001 #ifndef _3dstypes_hh_ 00002 #define _3dstypes_hh_ 00003 00004 //#include <stdio.h> 00005 //#include <stdlib.h> 00006 //#include <math.h> 00007 //#include <fstream> 00008 #include <vector> 00009 //#include <crtdbg.h> 00010 00011 #define MAX_TEXTURES 100 // The maximum amount of textures to load 00012 00013 struct tVector3 { 00014 float x, y, z; 00015 }; 00016 00017 struct tVector2 { 00018 float x, y; 00019 }; 00020 00021 struct tFace 00022 { 00023 int vertIndex[3]; // indicies for the verts that make up this triangle 00024 int coordIndex[3]; // indicies for the tex coords to texture this face 00025 }; 00026 00027 struct tMaterialInfo 00028 { 00029 char strName[255]; // The texture name 00030 char strFile[255]; // The texture file name (If this is set it's a texture map) 00031 BYTE color[3]; // The color of the object (R, G, B) 00032 int texureId; // the texture ID 00033 float uTile; // u tiling of texture (Currently not used) 00034 float vTile; // v tiling of texture (Currently not used) 00035 float uOffset; // u offset of texture (Currently not used) 00036 float vOffset; // v offset of texture (Currently not used) 00037 } ; 00038 00039 struct t3DObject 00040 { 00041 int numOfVerts; // The number of verts in the model 00042 int numOfFaces; // The number of faces in the model 00043 int numTexVertex; // The number of texture coordinates 00044 int materialID; // The texture ID to use, which is the index into our texture array 00045 bool bHasTexture; // This is TRUE if there is a texture map for this object 00046 char strName[255]; // The name of the object 00047 tVector3 *pVerts; // The object's vertices 00048 tVector3 *pNormals; // The object's normals 00049 tVector2 *pTexVerts; // The texture's UV coordinates 00050 tFace *pFaces; // The faces information of the object 00051 }; 00052 00053 struct t3DModel 00054 { 00055 int numOfObjects; // The number of objects in the model 00056 int numOfMaterials; // The number of materials for the model 00057 vector<tMaterialInfo> pMaterials; // The list of material information (Textures and colors) 00058 vector<t3DObject> pObject; // The object list for our model 00059 }; 00060 00061 #endif 00062