Jump to content
  • Advertisement
Sign in to follow this  
myvraccount

Animated Parameterized Models

This topic is 1418 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is sort of a programming/graphic design question, because depending on how it's implemented it might be either or both, so I hope this is the right spot to post it.

 

Anyway, I was wondering how to make parameterized models.  By that I mean, like the facial structure of the main character of Dragon Age Origins, for example, how it can all be customized by setting variables that control the size and shape of different parts.

 

Also, how could I apply this to a model that can be animated?  I'd like it with per-vertex animation, so that the character can have animations for talking, etc.  But I'd also like to use bones, which is probably easier, except then there's the potential problem that different parts may overlap (like an arm goes through a chest, because they're both stretched too big, or something).

 

Ideally, it would also be nice to make this all compatible with deformable meshes, such as from crashing or bending (like car crashes in racing games).

 

But my main concern is first parameterization, and then vertex animations overlaid on those same models.

 

So, any ideas?  Thanks.

Share this post


Link to post
Share on other sites
Advertisement

Carl Granberg, in his book "Character Animation With Direct3D," devotes a couple of chapters to just what you're discussing (regarding facial animation, parameterization, etc. Although the code is based on DirectX 9, the principles (including the math) of creating a face mesh, changing it's characteristics parametrically, syncing sound, etc., are well discussed. The book is under 30USD and, for what you're asking about, would be well worth the investment IMHO. Those face animations can be combined with a skinned mesh hierarchy.

 

Actually, the entire book discusses implementation of a "bone" based skinned mesh hierarchy, along with vertex animation. You may also want to look through this article for a discussion of skinned mesh animation using matrices. There are several articles regarding animation (parameterized and not) here on gamedev. Take a look at the Articles tab above, particularly under Graphics Programming and Theory.

Edited by Buckeye

Share this post


Link to post
Share on other sites

Well I looked through the article but I didn't see anything about parameters, the way that I mean them anyway.  Frankly the article seemed a little basic since I already know how to do animation, just not with parameters (maybe that's not even the right term).

 

And I looked at the index of the book and it didn't mention anything that looks like what I need, so I'm hesitant to buy something if it won't necessarily do any good.

 

Maybe I can explain better what I need:

 

If you've played games like Dragon Age Origins (or Skyrim also, I believe), at the beginning, you can set the structure of a character's face by choosing lots of values for the chin width, nose length, eye separation, etc.  I would think this would be done using something similar to regular facial animations, where you move the vertices from their default position and save a key frame, then later you can set a percentage to apply it and it will move that much along from the default position to the altered position.  This could be set with parameters, rather than the timing of an animation.

 

However, it would be a little different, because there are a lot of dependencies.  For example, the height of a lip or length of a nose will affect the height of an entire face, and some parameters may be relative to other ones, like eye separation may be in addition to the separation already imposed by nose width.  So I'm not sure this can all be done with just normal facial animations.

 

To make matters worse, how can an altered facial state be imposed on a facial feature already altered by a parameter?  If each one is made as an independent diversion from the default model, to apply them together would surely be more than just adding the distances of vertex movements, wouldn't it?

 

Also, suppose I want to apply deformations onto animated models, with or without parameters.  For example, a person has a built-in animation for reaching up and grabbing a doorknob and opening it.  First of all, if the person's arm is broken so that it's bent in a strange direction from the elbow (or as a vertex alteration, without necessarily using bones, but deformed regardless), then how will the animation look when the person reaches up, and in what way will the hand be in a different location, and how could the doorknob still be reached, if not for inverse kinematics (which wouldn't apply to static animations anyway)?

Share this post


Link to post
Share on other sites

Hi myvraccount,

 

You should implement the parameterized face shapes with morph targets or you might also know them as blend shapes. When you use morph targets the topology of the base model is not changing. This means the order and structure of the vertex and index buffers are not changing at all and the only thing is changing is the position of the vertices. So if you have a basic model you can move his/her nose vertices and save it as morph target and again on the base model change his/her eyes vertices and save it as another morph target. So now you have two morph targets and you can blend your base model with these two and achieve various results based on the parameters. 3D modelers know how to make different variations on a base model with same topology so you just need to hire a good one ;)

 

For the animations on the parameterized face or models you should not be worried. As i mentioned the topology of the mesh is not changing in morph targets and it's just the position of the vertices that are changing. So first you just need to apply the normal animation with its skinning data to the base model and after that you should apply the morph targets blending on top of it.

 

To apply the morph targets blending you need to save the differential position of each vertex in an array. This means after you finalized the the parameterization of your character and customized it, you should save the paremterized model vertices positions (in modeling space) and calculate the difference of each of its vertices with the base model and save it in an array or buffer and then after you applied the normal animation on the base model you should add that differential to each vertex. For example you have a character that can move his jaw with bones. To apply the final animation you have to compute the basic model vertex positions based on the bone animations and then you need to apply the differential positions to each vertex after that to achieve the final shape.

 

The book which buckeye mentioned has described how to implement the skinned mesh and morph blending in separated chapters. It already said how to combine skeletal animation and morph animations. So you might give it a try, it's a good book and answers the basic questions on animation programming very well.

 

Hope this would help

Share this post


Link to post
Share on other sites

Thanks a lot.  I'll keep all that in mind.  I didn't realize I could just add the differences though.  It seemed like that could cause conflicts some how, like it could cause anomalies in the model.  I can't think of a specific example and it's hard to describe, but it's just something I was afraid would happen.  But if you're sure it wouldn't, then I guess there's nothing to worry about.  I'll check out the book, too.

Share this post


Link to post
Share on other sites

It seemed like that could cause conflicts some how, like it could cause anomalies in the model.  I can't think of a specific example and it's hard to describe, but it's just something I was afraid would happen.

 

Actually you should do some more things to apply differentials to the final model. You may just search about the combination of morph and skeletal animation and you'll find out more about it. It's a solved problem :)

 

The important thing is that you need to save the finalized and customized model in a single buffer. You might have many morph targets for customization and you don't need them after you finalized the model. Having all of the morph targets during gameplay is not a good idea as they can take much memory so saving the finalized model and calculating the differences from base model can help you achieve this better.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!