PDA

View Full Version : Md2 animation - frame organization



ioquan
05-12-2002, 01:01 PM
If you're familiar with the md2 format, you know that the vertices are read as a list of keyframes. Well, I have all the frames loaded into ram, but I dont know how to determine where the frames for each animation start. There is no info about that in the file header(except the total number of frames), nor in the offsetFrames section of the file. I havent found anything on the web that tells you how to determine where the animation frames start. If anyone has any info, it would be much appreciated.

sanjo
05-12-2002, 09:20 PM
i have used a table with [startframe,endrame,fps] here is the table ->

Q2AnimTBL[MAX_ANIMS] =
{
0,39,15.0f,
40,46,15.0f,
47,60,15.0f,
61,66,15.0f,
67,73,15.0f,
74,95,15.0f,
96,112,15.0f,
113,122,15.0f,
123,135,15.0f,
136,154,15.0f,
155,161,15.0f,
162,169,15.0f,
170,177,15.0f,
178,185,15.0f,
186,190,15.0f,
191,198,15.0f,
};

and here are the indices to the table->
enum q2Anims
{
IDLE=0,
RUNNING,
SHOT,
SHOT_SHOULDER,
JUMP,
IDLE2,
SHOT_FALL,
IDLE3,
IDLE4,
CROUCH,
CROUCH_CRAWL,
CROUCH_IDLE,
DIE_KNEE,
DIE_BACK,
DIE_FOR,
DIE_BACK_SLOW,
MAX_ANIMS
};