Archived

This topic is now archived and is closed to further replies.

SIGMA

Quake's md3 format...

Recommended Posts

Hey, can anybody point me to a listing of the md3 format? I couldn''t find it on Wotsit''s! (gasp!) Also, does the md3 include all the fun skeletal info? If it doesn''t, can someone point me out to a handy format that is very detailed? Thanks, -Jesse

Share this post


Link to post
Share on other sites
Okay, after about 3 hours of searching I found it on some small little quake3 forum, here it is:
typedef unsigned int uint_t;
typedef unsigned char byte_t;
typedef float texcoord_t[2];
typedef float bboxf_t[6];
typedef float mat3_t[9]; // 3x3 matrix

/* Each MD3 model is composed of one or more meshes. Currently the md3
* loader is used only for mapents, so animated (multiframe) models
* are not supported.
*/

typedef struct
{
int shader; /* Shader reference */
int numverts;
vec3_t *points;
texcoord_t *tex_st; /* Texture coords */
texcoord_t *env_st; /* Used for environment mapping ? */
int numelems;
uint_t *elems;
} md3mesh_t;

typedef struct
{
bboxf_t bbox;
int nummeshes;
md3mesh_t *meshes;
} md3model_t;

typedef struct
{
char id[4];
int version;
char filename[68];
int numboneframes;
int numtags;
int nummeshes;
int headerlen;
int bone_offs;
int tag_offs;
int mesh_offs;
} md3header_t;

typedef struct
{
char name[64];
vec3_t pos;
mat3_t rot;
} md3tag_t;

typedef struct
{
bboxf_t bbox;
vec3_t pos;
float scale;
char creator[16];
} md3boneframe_t;

typedef struct
{
char id[4];
char name[68];
int numframes;
int numskins;
int numverts;
int numtris;
int elem_offs;
int skin_offs;
int tc_offs;
int vert_offs;
int meshsize;
} md3mesh_file_t;

typedef struct
{
signed short vec[3];
byte_t tc[2];
} md3vert_t;
Thanks for all the help (no sarcasm here )
-Jesse

Share this post


Link to post
Share on other sites