Hi Edge,
I have a question which is very important for me. The question is: which is the best way to handle the animations of the characters. A few ways that come into my head:
1) Making a separate milkshape file for each animation cycle(walk, idle, run ...)
2) Make a one milkshape model with a range of animation cycles and than somehow call the exact animation cycle you need (walk, idle, run ...), just don't know how to do it because you have a time based animation system.
Any help would be great.
Hi Scihunter,
We recommend keeping all animations in one model to save filespace and increase loading speed. To convert time to the animation frame we recommend using this formula:
- Code:
time = frame * 1000 / fps
The FPS depends on the model, but is usually 60.
Hello Edge,
Could you be so kind to write down a code example of how to play the exact animation frame cycle for example from 5 to 20 frame (plays 15 frames of animation) on the turtle example you have in the Edge pack. Could you just modify it so that the turtle would play only 15 frames of animation. I just didn't get how to make it with model.Animate(); function.
Hi,
To play only a number of animation frames you can adjust the Animate function call in the Animate3D sample with this:
- Code:
#define FRAMETOTIME(f) ((f) * 1000 / 60)
#define TIMETOFRAME(f) ((f) * 60 / 1000)
turtle.Animate(FRAMETOTIME(5) + timedelta / 2 % FRAMETOTIME(15))
Hi, Edge
strange but it didn't work out, I have been adjusting the Animate function as you said but the turtle animate only 1 frame and repeatedly twitches. What have I done wrong.
Hi,
We've taken a look at the turtle model, and noticed a different FPS setting than most other models. Here are the code adjustments:
- Code:
#define FRAMETOTIME(f) ((f) * 1000 / 24)
turtle.Animate(FRAMETOTIME(26) + anitimer / 2 % FRAMETOTIME(14));
I've also changed the animation loop to frames 26 to 40.
Hi Edge,
Yeah now everything is just great. Thank you so much. Btw it seems like all Psionic 3D models have 24 FPS

Hi again Edge,
Just a little question. Is there a way to play the animation in the reverse order?
Hi Scihunter,
Reversing animation is possible as well. Here is a sample:
- Code:
turtle.Animate(FRAMETOTIME(40) - anitimer / 2 % FRAMETOTIME(14));
(apologies in advance for my ignorance) but what is the best way to put "all animations in one model" ? It seems milkshape itself just exports a single animation cycle in its native format, or am I missing something fundamental here.
thanks in advance
Chris
Hi Chris,
If you open the turtle model you can see how it's done. Each animation uses different frames (for example, 0 to 11 is used for walking).
In fact, all animations are sticked together and you can play a single animation by using certain frames.