Sign in to follow this  
Hannesnisula

Creating an animation system

Recommended Posts

I don't know whether this was the right forum or not. If not, I apologize. I'm trying to create an animation system for my game project and since it's supposed to be a RPG of some kind I will have rather many characters in game at the same time, both some that need their own instance of the animation and some that will share one, like guards. I'm quite unsure of how this stuff really works and I haven't been able to find much about it so my questions are: 1) Should I create an animation controller which I would just need 1 instance of that will do all calculations for all the animations/animation instances? 2) I'm currently loading animations from a file and since I need several instances of the same animation should I have 1 animation which mustn't be changed and then clone all the instances from it? 3) What would I need for each animation instance? A set of bones with their respective keyframes that will be advanced through time by the Animation Controller? So my whole structure is an Animation Controller to do the calculations, a set of Animations which contains the length of them, all keyframes, name of the animation etc. Also there'd be the Animation Instance structures which should contain a reference to the Animation (to make the Animation Controller able to access the animation keyframes etc) and a set of matrices representing the current transformation. What are your thoughts on this?

Share this post


Link to post
Share on other sites
Get one mesh animating first.

Quote:
Should I create an animation controller which I would just need 1 instance of that will do all calculations for all the animations/animation instances?


Sure. Just have the instances have a pointer to that animation controller. You can pass variables like what keyframe you want it to compute, a blend factor if you are blending keyframes.

Quote:
What would I need for each animation instance? A set of bones with their respective keyframes that will be advanced through time by the Animation Controller?


Your set of bones are just matrices. So you will need to compute a new matrix for each bone every time you draw a new version of your model. Again the way I do it is all the instances call on the animation controller to compute new matrices.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this