Multiple animations?

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
Keanu
Posts: 13
Joined: Sun Jan 04, 2004 11:10 am
Location: Italy
Contact:

Multiple animations?

Post by Keanu »

I was wandering wich is the best way to load multiple animations? I'm using Milkshape 3D and I'm creating one mesh for each animation. When the player walks I display the mesh with walking animation and hide all the others and when he attacks, I hide the mesh that walks, move the mesh that attacks to the current position and display it; and so on... I really think this is not politically correct
P4 2.53MHz 256MB GeForce4Mx VC++6.0
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

definately not the right way.

only have 1 mesh.

lets pretend you've got 4 different animations, who's frame counts are 5, 10, 10, and 20.

you should apply all these frames to the same mesh in one mesh file-- so it has one long animation of 45 frames (which represents the 4 different animations all one right after the other).

In your game logic you tell an animated mesh what frames to use. to run the first animation, tell it frames 0-4. When you want the 2nd animation, tell it frames 5-14, for 3rd animation 14-23, for the last animation 23-44.
a screen cap is worth 0x100000 DWORDS
Keanu
Posts: 13
Joined: Sun Jan 04, 2004 11:10 am
Location: Italy
Contact:

Post by Keanu »

Thank you as always you solve all of my problems!
P4 2.53MHz 256MB GeForce4Mx VC++6.0
Post Reply