how to sync transition and animation

Started by
4 comments, last by dellos 11 years, 1 month ago

Hi all.

I started to write a class ( use lua ) obj with methods: rotation , transition, scale.

then I use this class to create all character's packge like head, arm,.....

now I have a character obj with each part of character have rotation, transition and scale method.

but my problem is:

1. how to one action sync with other ? example; rotation head sync with swing arm,.....

2. what is best way to wirte all action sequence for call when i need?

Advertisement

I personally have a set of classes whose only job is to provide different interpolation types (Easing Equations) these are the popular ones and are easy to implement. I then have another class to which you can pass these interpolators which are "chained" together in the right order.

So, for example, I might have

1)opacity-> 0 to 255 in 2.5 seconds using the linear interpolatr AND size-> 0 to 1 in 2.5 seconds using the out cubic interpolator

2)(the 2nd step starts after the first one) rotate the effect from 0 degrees to 180 degrees in 1 second using the sine interpolator

3) size from 1->0 in 0.5 seconds using the in quadratic interpolator

and so on. I use angelscript (a scripting language) to control these transitions. you could use lua to do the same.

Hope this gives you a fair idea on how to implement something similar :)

~Bollu

a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)

thank for reply, but as I was presented .

I was make all transition , rotation , scale. Each of it I can controll Time , radius and scale ratio ,

now I focus on How to sync all trasition and How to make
something like a action Type , in each action Type have many of
transition, rotation, scale of each part of Character object.

I think I need bester structure(architecture) . please advice

The way some games do it is to create a very detailed hierarchical state machine for all the states of the characters animation this includes transition states. They use a combination of procedural animation like Inverse Kinematics with motion targeting and mixed with hand animation overlaid.

See this video for example

">

See this page

http://aigamedev.com/open/editorial/animation-revolution/

I'm sure you can adapt a simpler from for your use case, but that's the idea.

Good Luck!

It seem not easy like I was think.

I personally have a set of classes whose only job is to provide different interpolation types (Easing Equations) these are the popular ones and are easy to implement. I then have another class to which you can pass these interpolators which are "chained" together in the right order.

So, for example, I might have

1)opacity-> 0 to 255 in 2.5 seconds using the linear interpolatr AND size-> 0 to 1 in 2.5 seconds using the out cubic interpolator

2)(the 2nd step starts after the first one) rotate the effect from 0 degrees to 180 degrees in 1 second using the sine interpolator

3) size from 1->0 in 0.5 seconds using the in quadratic interpolator

and so on. I use angelscript (a scripting language) to control these transitions. you could use lua to do the same.

Hope this gives you a fair idea on how to implement something similar smile.png

~Bollu

hi Bollu

can you explain some function in your link. i understand how it work but not sure about what I need to change. example I want to transition with time is 100ms. from x =0 to x =100. ?

This topic is closed to new replies.

Advertisement