MD2 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
Marquis

MD2 Animation

Post 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 ?
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post 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 ==
Marquis

Stop

Post 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.
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post 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.
Post Reply