Big frame count

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
i245
Posts: 8
Joined: Sun May 20, 2007 5:16 pm

Big frame count

Post by i245 »

Hello, i wanna save animated mesh and i have a problem.
When i get frame count from fearie.md2 mesh (IAnimatedMesh::getFrameCount) i have - 792 frames(!)... What i do wrong? Why this is very big? I think, it should be 100-200...
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

How can you save your MD2 animated model from IRRlicht?! IRRlicht can only save IRRmesh and only for static objects now. There is no animated mesh save feature implemented (as for now)

I've loaded MD2 files in my model viewer and they seem to respect that format. You could use my model viewer (with animation preview) to check for that.

Here is the Faerie loaded in my model viewer: (0 to 191 = 792 frames)
Image

For the frame size, I think IRRlicht somewhat scale them for 30FPS playback. I think the original frames are calculated to play at 12FPS or 10FPS. (Using the slider, each 3 frames are the same, then the 4th is different and so on.)

If you play back the animation at 30FPs it play correctly. So you could check if you have a text description about the frames loop description, to multiply them by 4 and the frame range should match. MD2 animations have multiple animation inside the same, and their range is fixed.

Here found the animation loop description for the MD2 frames:
This is the original animation frames range description for the Quake Engine (12 FPS)

Quake
{ 0, 39, 9 }, // STAND
{ 40, 45, 10 }, // RUN
{ 46, 53, 10 }, // ATTACK
{ 54, 57, 7 }, // PAIN_A
{ 58, 61, 7 }, // PAIN_B
{ 62, 65, 7 }, // PAIN_C
{ 66, 71, 7 }, // JUMP
{ 72, 83, 7 }, // FLIP
{ 84, 94, 7 }, // SALUTE
{ 95, 111, 10 }, // FALLBACK
{ 112, 122, 7 }, // WAVE
{ 123, 134, 6 }, // POINT
{ 135, 153, 10 }, // CROUCH_STAND
{ 154, 159, 7 }, // CROUCH_WALK
{ 160, 168, 10 }, // CROUCH_ATTACK
{ 169, 172, 7 }, // CROUCH_PAIN
{ 173, 177, 5 }, // CROUCH_DEATH
{ 178, 183, 7 }, // DEATH_FALLBACK
{ 184, 189, 7 }, // DEATH_FALLFORWARD
{ 190, 197, 7 }, // DEATH_FALLBACKSLOW
{ 198, 198, 5 }, // BOOM
Frames corrected to be used in IRRlicht engine (30 FPS)
Irrlicht
{ 0, 156, 9 }, // STAND
{ 160, 180, 10 }, // RUN
{ 184, 212, 10 }, // ATTACK
{ 216, 228, 7 }, // PAIN_A
{ 232, 244, 7 }, // PAIN_B
{ 248, 260, 7 }, // PAIN_C
{ 264, 284, 7 }, // JUMP
{ 288, 332, 7 }, // FLIP
{ 336, 376, 7 }, // SALUTE
{ 380, 444, 10 }, // FALLBACK
{ 448, 488, 7 }, // WAVE
{ 492, 536, 6 }, // POINT
{ 540, 612, 10 }, // CROUCH_STAND
{ 616, 636, 7 }, // CROUCH_WALK
{ 640, 672, 10 }, // CROUCH_ATTACK
{ 676, 688, 7 }, // CROUCH_PAIN
{ 692, 708, 5 }, // CROUCH_DEATH
{ 712, 732, 7 }, // DEATH_FALLBACK
{ 736, 756, 7 }, // DEATH_FALLFORWARD
{ 760, 788, 7 }, // DEATH_FALLBACKSLOW
{ 792, 792, 5 }, // BOOM
i245
Posts: 8
Joined: Sun May 20, 2007 5:16 pm

Post by i245 »

I export it to my own format (i code my own export function), thx for help. Now i know what i do wrong.
Post Reply