Model Animation

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
Handle
Posts: 19
Joined: Tue Jul 13, 2004 2:00 pm

Model Animation

Post by Handle »

Hi huys, I've been having a problem with animation with both MD2 & MS3D files the frame numbers in the files seem to have no correlation to the frame numbers used when irrlicht's playing the animation.

A search of the forum found this small discussion:
buhatkj:
anybody else notice when working with custom md2's(non-standard animations) that now(in 0.5, this wasn't the case in 0.4.2) there are 8* the number of frames according to irrlicht than there are actually in the file??
i've noticed the same thing with ms3d files, only the multiplier is different, in milkshape files there is like 1000* the number of actual frames according to irrlicht....

what's up with that? anybody know why this is?
-Ted

niko:
This is currently because the method only accepts integer values as frame time, no floats. But this is subject to change.

buhatkj:
ahh so it'sd because of how it interpolates then right?

so it multiplies it by the number of fps to get the interpolated frame count?
interesting...
However my problem is how do I play an animation loop, e.g.

m_Model_Node->setFrameLoop(0, 10)

if the framerate is constantly changing?

I may be missing something here so if someone could explain how to play a loop of animation between two defined frames I'd be grateful, I'm sure quite a few folk must have done this in their game?

Cheers Handle
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

animation frames and framerate are in this case two diferent things.

Animation frames refer to frames animation consist of,

while framerate is number of frames per second your program can refresh your display(scene).

Aslo when you make animation, you make it of key frames which is again not the same as animation frames.

Key frames are as name suggest key frames between which program automaticly insert and calculate animation frames. Howe many frames to insert you can set in modeler or animator setup normaly.

For example your animation is made of 10 keyframes and program inserts 9 frames between each key frames. Your animation will end up to be of 100 frames big.

Another thing is animation speed you can set in Irrlicht. This is not display frames dependant but time dependant. So it is number of frames to play per second.
Guest

Post by Guest »

Cheers for the help Aras but I'd like to clarify a few points

I understand the concepts of framerate, animation speed and keyframes however however I was under the impression that Irrlicht would calcutate the intervening frames (via linear interpolation I assume) dependant on the framerate that my application was running at.

To illustrate my problem I created a short 5-keyframe animation and use no external program to generate additional frames between the keyframes.

When I load the model into irrlicht (and the default animation loop runs throught all the frames in the model) the animation appears fine and runs smoothly (hence is Irrlicht generating it's own frames between keyframes?). How ever as soon as say I tell the model to loop from say frames 2 - 4 (m_Model_Node->setFrameLoop(2, 4) ) Animation doesn't play.

Now I understand when you say that there are additional frames generated between keyframes, however as I have NOT added any myself which is the figure that Irrlicht will have added? Will it be the non framerate dependant animation speed hence the lline: should become:

(m_Model_Node->setFrameLoop(2*animationspeed, 4*animationspeed) )

or is it dependant on the dynamic framerate:

(m_Model_Node->setFrameLoop(2*framerate, 4*framerate) )

in which case there would be a problem as my framerate is not constant.

I actually did a quick test with the animation speed but the frame numbers still seemed to bear no correlation to this time dependant playback rate?
Handle
Posts: 19
Joined: Tue Jul 13, 2004 2:00 pm

Post by Handle »

The above post was by me, I forgot to log in :oops:
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

that overcross my knoweledge about engine ...sorry I don't know that.
Stainless
Posts: 7
Joined: Sat Jan 06, 2007 1:54 pm

Post by Stainless »

Irrlicht interpolates between keyframes, as it should.


On my build it uses 8 frames per keyframe so if you want to set animation between keyframes 1 and 10 you would need to use 1*8 and 10*8
a_haouchar
Posts: 97
Joined: Sat Oct 14, 2006 10:51 am
Location: Australia,melbourne

Post by a_haouchar »

WOOOW this is old,you didn have to reply to a 3 year old thread:)
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

As long as its informitive and contributes to the subject I don't think it matters how old it is.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I noticed this too with the 8*, it should be better documented.
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

BlindSide wrote:I noticed this too with the 8*, it should be better documented.
yes i think soo because i have tired of guessing :evil: which number to multiply !! but now in 1.3.1 it is changed to more than 8 and this is not good and also i saw that irredit is different from irrlicht 1.3.1 although irredit runs by 1.3.1 and the difference is in animation speed i have to decrease it in irredit and i have to increase it in my application!!!!
so any one can tell me wht is the new number!!? :wink:
Post Reply