Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm using XNA, and I'm well versed with the skinnedModel sample. I'm starting to make my own models and animations. I'd like to be able to take animations that apply to different, independent body parts and combine them. For example:

Let's say I have some animations for my characters body:

  • running
  • walking
  • standing

I also have some animations for my characters face:

  • frowning
  • smiling

Ideally, I'd like my character to have any facial expression when doing any action. So, they could be:

  • walking while smiling.
  • walking while frowning.
  • running while smiling.
  • running while frowning
  • ... and so on ...

However, I'm not sure how I should best manage this. I know that I could make N*M different animations (where N is the number of body animations and M is the number of face animations) and import them all, but this seems like a lot of work as the number of animations starts to increase.

If anyone has a smart way to handle this, I'd love to hear it.

share|improve this question
3  
keep the face and body as separated sprites. –  Gustavo Maciel May 23 '12 at 22:21
add comment

2 Answers

The technique you're looking for is called "animation blending."

At the simplest level, this means that you take the bone positions of all current animations and "average" them out.

The skinned mesh sample should be easy to modify to do this yourself.

There is a lot more math behind doing things "right" but that'll get you started and you should be able to google more information now that you have the right keywords to search on.

share|improve this answer
add comment

Well, if you want something X and Y which can be combined freely, then you composition. For that you need to make parts X and Y independent from each other. Thus, as @GustavoMaciel suggests you need to separate face and body parts.

However the challenge here lies in the ability to combine parts smothly. So it can be quite possible that drawing all possible combinations can produce better results.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.