animation pausing when looping?

Blitz3D Forums/Blitz3D Programming/animation pausing when looping?

cyberyoyo(Posted 2009) [#1]
This must be a very simple problem, I hope you can help me.

I'm trying to make a rotor type animation, it is supposed to be constantly playing and giving the impression of a fan turning.
It is setup like this:
frame1=rotor angle 0
frame2=rotor angle 90
frame3=rotor angle 180
frame4=rotor angle -90
frame5=rotor angle 0
Only problem is for some reason the animation pauses at the end of the sequence instead of seamlessly looping.
Any idea what I'm doing wrong?
Why is there a pause betweeen frame4 and frame 1? Can I get rid of it?


Santiworld(Posted 2009) [#2]
you have two angle 0.. in frame 5 and 1

start

frame1=rotor angle 0
frame2=rotor angle 90
frame3=rotor angle 180
frame4=rotor angle -90

repeat

i hope that this can help you.
(sorry my english)


cyberyoyo(Posted 2009) [#3]
Yeah I already tried that.
But for some reason it doesn't interpolate between last frame and first frame.
In this configuration, it just jumps from -90 to 0.


Warner(Posted 2009) [#4]
Maybe you can use SetAnimTime fan, (millisecs() * 0.1) mod 5 instead of Animate?


Ross C(Posted 2009) [#5]
I would set anim time half for both the 0 and 5 frame. That way, it will add up to one full frame time.


cyberyoyo(Posted 2009) [#6]
I managed to fix the problem by increasing the number of animation keys in the editor (256 instead of 4) so that now the hiccup becomes so small that it's not noticeable.

But is it normal to have a pause at the end of a seamlessly looping sequence? how to get rid of it?
If I set the last anim key as identical to the first one, there appears a pause on that position, if I calculate the numbers of keys and set the last one a bit anterior to the first anim (like latatoy's answer), then the move is chronologically correct but the rotor just jumps from the last key to the first one (instead of interpolating to it), still with a pause on the last key.
Is there a more correct way to fix that problem and make the move absolutely perfect?


Warner(Posted 2009) [#7]
Again, use SetAnimTime, it gives more control.