FBX split animation sequence study

Hello guys.
I’m following the code from this example: https://jsfiddle.net/baxshzrm/1/
and made some changes:

function onKeys (event) {

event.preventDefault ();

var frame = clock.getDelta (); 

for (var i = 0; i < mixers.length; i ++) {
   mixers [i] .update (frame + 10 * +0.05);

window.addEventListener (“keypress”, onKeys, false);

I noticed that when you press a button any of the animation is skipping the keyframes, in this case (I think) 10 frames ahead, but without executing the other frames of the animation.
I found it interesting, because if we can adjust it we can map animations to the file.
I’m loading a .FBX template.

Would it be useful to study this? I would appreciate the help as I prefer working with fbx.

I also took a look at the AnimationMixer class but I could not quite understand what to do to stop counting frames or delimit counting.

The loaded animations are time based, not frame based.

You should rename frame to delta, it’s the time since you last called clock.getDelta().

Which means that you are skipping ahead by the amount of time since you last pressed a key, plus 10*0.05 = 0.5 seconds. Essentially, a random amount.

See this example for how to correctly play back FBX animations:


Right. Let see what i can get. For now, thancks.

1 Like