0
\$\begingroup\$

That's my first question here so i hope to do all correctly. From various weeks i started surfing the net about Skeletal animation aiming to add a simple animation controller into my small game engine. After following a video tutorial by ThinMatrix, i successfully added skeletal animation into my engine (i used Assimp to load a .dae file from Blender with one animation in it). Once finished all the base stuff i started thinking about how to change animations speed by a factor (like x2 x3 etc...) and here i found some problems. As i think i understand every animation is measured by a duration field (in ticks) that, as i suppose, should be at least something like 25fps (to obtain some kind of smooth animation) times animation's length in seconds. Then for every animation there is also another field called ticksPerSecond that (as the name says) is the amount of ticks in every second.

Into my engine i've a data structure called Animator that contains an array of Animation objects and for each one it has a ticks_per_second and duration array. The following code shows how i took data from assimp.

animator->ticks_per_second[animation_index] = scene->mAnimations[animation_index]->mTicksPerSecond != 0 ?
    scene->mAnimations[animation_index]->mTicksPerSecond : 25.f;
animator->duration[animation_index] = scene->mAnimations[animation_index]->mDuration;

If i print the two variables i get this result:

DEBUG: ticks per sec: 1.000000
DEBUG: total ticks: 0.833333

So here is my question: Why do these variables take on these values? I am trying to explain it to myself and the idea I found is that if ticks is equal to 1 the animation would go at the same mainloop's frame rate but, at the end, I am not sure about it and I would appreciate your help.

\$\endgroup\$
  • \$\begingroup\$ Can you show us how these values are computed in your code? Imagine an animation expert reading this question. If they have all the information they need to understand your situation in the question itself, then they can answer you right away. If they have to go watch and follow along the same video tutorial you did before they even know how your system works, then your answers will be delayed at the very least. Or the expert might just go elsewhere! So, make it as easy as possible to get this info in the body of your question itself. \$\endgroup\$ – DMGregory Aug 30 at 17:08
  • \$\begingroup\$ @DMGregory these values are taken directly from Assimp. Anyway i'm going to update the question with a snippet of code that shows how i take these values from Assimp. \$\endgroup\$ – Gianmarco Aug 30 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.