Jump to content
  • Advertisement
Sign in to follow this  
C3rial

animation help please

This topic is 3157 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

Hi! I was thinking of making a character creation application, but I'm not sure of the best way of doing this. The character creation in Fallout 3 and The Godfather are good examples of what I mean. How is this done? When we set the "chin-width"-variable higher - what are we actually changing? The mesh itself or the size of that particular bone? What I would like to end up with is one of my own 3d models, with the necessary bone-structure and be able to alter the appearance of it by setting chin-width, nose-width, nose-height, forehead-width, eye-size and stuff like this. Know what I mean? Thank you! Regards C3rial

Share this post


Link to post
Share on other sites
Advertisement
I think the way this is done is by using vertex morphing. I could be wrong with the details, and if so i hope someone corrects me but...

#1 - have a normal face model and a model with a big chin.
#2 - set up a slider that changes a value from 0 to 1
#3 - use linear interpolation of the verts from the normal model and the verts on the big chin model, using the value from the slider for how far to interpolate from 1 to the other.

I think that's how it works...

Share this post


Link to post
Share on other sites
Thanks for you reply!:)

The best way to do that
will probably be with a shader than, am I correct?
Using the lerp-function somehow...?

I'd like to add to my query that
I would like to end up with a base head that
which appearance can be manipulated through variables,
and also has a set of animation sequences.
So that no matter if the chin is big and the
forehead sticks out, the animations still work.
Know what I mean?:)

Share this post


Link to post
Share on other sites
Ive never done this myself, but seeing as it seems to act like an editor, I would think you would modify a copy of the actual base model in memory and then use that modified model in game in place of where you might load the default had the user made no modifications.
When saving you might just save the values that were changed and remodify the base model when loading, or if the changes take too long to produce, maybe save the whole model with changes (vertex data only) to disk and load that next time.

Share this post


Link to post
Share on other sites
Do you think it would be possible to use the bones to
manipulate the model? The same bones we use for
animation.
E.g the model has a chin bone, and we scale this
x2 in the application...and that way the mesh
around that bone would "move" accordingly?
Just figured I'd ask around before I start
testing 15 different ways of doing it.
Thanks for your replies guys!

Share this post


Link to post
Share on other sites
Quote:
Original post by C3rial
will probably be with a shader than, am I correct?
Using the lerp-function somehow...?


FinalVertex = (TargetVertex-BaseVertex) * weight + BaseVertex;

Allows you to combine more than one blend shape. This can be done in a shader (you'll have to slerp the normals) if needed. This is by far the simplest method to get working.

Quote:
Do you think it would be possible to use the bones to
manipulate the model? The same bones we use for
animation.


That's the other way of doing it. Typically you'll set those up using setDrivenKeys in Maya, or parameter wiring + expressions in 3ds Max. You will most likely need to write yourself a custom exporter to be able to extract the data in a meaningful way though. The main advantage of this system is that once you've set up the face rig, and face targets, you can simply re-use it for all character meshes.

The big disadvantage is the amount of effort you'll need to go to get this working. It's fairly non-trivial to get hold of meaningful data for the system.

Share this post


Link to post
Share on other sites
however you distort your verts to get the final result, animations will still work because your verts will still be attached to the same bones (:

if you alter your bones to get the desired effect, it may screw with animations since animations do things to your bones to animate. It probably will conflict with your changes unless you combine your bone changes with the animation bone changes somehow.

That seems complicated and something that wouldn't be real easy to get working.

I would say you should lerp between the vertex points personally (:

Something else though is if you don't want to lerp all the vertices each frame, you could do the lerp once and cache of the verts as your source model data.

Lerp once use many, ya know? (:

Share this post


Link to post
Share on other sites
Aye, mateys!
Thank you very much! I've gotten some good pointers
as to where I should start.
I'm not sure how I will do this.
Lerp seems to be the best way of doing it. However, I also
contacted a friend of mine who works as a modeller for
Funcom. She said the easiest way might be bonescaling, BUT
it's easy to make mistakes. Like you've pointed out I have
to make sure my animations can handle the scaling without
getting intersections, and that my textures also handle the
scaling.

That said - anyone know a good way of (in code) setting
UVW map to "box"? I know how to do this in 3ds, but if I
could do it in code I wouldn't necessarily have to worry
about the texture-scaling.
I might have to write my own importer, eh?

Share this post


Link to post
Share on other sites
Quote:
Original post by Atrix256
if you alter your bones to get the desired effect, it may screw with animations since animations do things to your bones to animate. It probably will conflict with your changes unless you combine your bone changes with the animation bone changes somehow.

That seems complicated and something that wouldn't be real easy to get working.

I would say you should lerp between the vertex points personally (:


Simple answer: make sure that the animation rig does not influence the skin. For each bone in the rig, add a child joint in the same place, and use those to drive the skin deformation. You can then modify the poses of those skin bones via lerping between targets.

Quote:
Original post by Atrix256
Something else though is if you don't want to lerp all the vertices each frame, you could do the lerp once and cache of the verts as your source model data.

Lerp once use many, ya know? (:


\edit [actually read a bit more]

Lazy evaluation can be used if the target weights don't change that often..

On the CPU you can do a diff between the target and the base mesh and store only the vertices that change for a given target, and just accumulate those. It's about as cheap a geometry deformation as you can get. That should keep the cost of lerping multiple character traits together.

Ultimately though, this is for a dcc application and not a game, so simply lerping all the verts isn't that big of a deal.

Share this post


Link to post
Share on other sites
Quote:
Original post by C3rial
She said the easiest way might be bonescaling


Ignore her. Scaling causes a myriad of nightmares you don't want to get involved with. If you do use scaling, make sure it's only the leaf joints that can be scaled (ie. the bone must not have children), and be sure to normalise your normals afterwards. Try and utilise translation and rotation as much as possible to generate the deformation.

You can always lerp the UV's as well if you have too......

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!