Page 1 of 1

MD2 Animation

Posted: Sat Mar 27, 2004 3:53 pm
by Marquis
How can we make a MD2 animation without looping.This type of animation is used by weapon for shoting and by character for is dead.

I want a animation from frame 1 to frame 5. After I want a frame stop at 5th frame.

Now I check in my Main() loop
if(node->getFrameNr()==endFrame )
by its not very effective.

How I can make it ?

Posted: Mon Mar 29, 2004 2:00 am
by Domarius
Well I'm only new to Irrlicht, but this is what I'd do when I start with that; look in the animation controls for a "stop" command. There would have to be one somewhere.

BTW you are right - your code isn't very effective.

It should be >= not ==

Since the animations are time based, it is more than likley that the exact frame you are waiting for will be skipped. In programming class, we are always taught to program safley, which usually involves using >= or <= instead of ==

Stop

Posted: Mon Mar 29, 2004 6:02 am
by Marquis
After the endFrame, the animation go to the beginFrame. It never has a frame > endFrame.

The is no way to get when the animation is at endFrame !
I will modify the Irrlicht source code for it.

Posted: Mon Mar 29, 2004 7:49 am
by Domarius
Okay, so endFrame is an animation property, I thought it was your variable.

Well another way I can think of off the top of my head, is to make a timer, that sets the frame to endFrame after the animation should have finished. It should work if the animations are time based.