cctan
cctan

Reputation: 2023

Smooth animation transition logic in Android OpenGL

I have an Android app developed using openGL and LibGDX.
Right now I do not know the strategy on how to code smooth transitions among a set of animations.

Example:

We have a cat actor.
Its animation consists of a set of key frames paired with transform matrix.
We have 5 preset animations for this cat:
idle, walk left, walk right, jump and lie down.

How can we transition from lets say
walk right => lie down
walk right => walk left
while the walk right animation is playing half way?

Right now once an animation starts, it needs to be played for 1 full cycle until the end.
This is so that the cat can move back into its neutral position.
Thus it can play the next animation which starts from a neutral position.
The final result is unnatural and jerky.

What approach should I use to tackle this problem?

Upvotes: 1

Views: 814

Answers (1)

Daahrien
Daahrien

Reputation: 10320

Just starting the next Animation even when the previous one isn't finished is the Standard way. It looks good, do not wait for the first Animation to finish.

If you still think it looks unnatural. Then you must create a very fast "transition frame" between animations that makes it look more natural. Not worth the effort if you ask me, just try it the first way :)

Upvotes: 1

Related Questions