Jump to content


Characters with different physical features or equipment


3 replies to this topic

#1 mstam

    New Member

  • Members
  • Pip
  • 2 posts

Posted 26 August 2010 - 09:30 PM

Hey people.

I've kind of run out of Google, not really sure what to specifically search for so I decided to write up a thread here.

I was wondering how one usually implements characters/avatars with different physical features and/or different equipment. An (what I'm guessing advanced) example of this would be when creating a sim in Sims 3 (http://games.softped...m-Trailer_2.jpg). How do they support different physical features? Not just changing nose but also making the characters skinny/fat, tall/short, different hair and so on.

Blend shapes/morph targets? All I can find regarding this is facial expressions and animations.

I'm lost, and I'm hoping that you can kind of point me in the right direction.

Thanks.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5340 posts
  • LocationSanta Clara, CA

Posted 26 August 2010 - 10:16 PM

Blend shapes would be my guess. I think the MakeHuman tool works that way; it has one master base mesh and then everything else is blend shapes. Anyway, it's open source so it might be useful to study to see how it does various transformations.

For height changes you presumably apply an overall scale to the skeleton as well. For accessories or switching among hairstyles etc. it's usually a simple matter of having many authored pieces of geometry that can be turned on and off. They're all pre-skinned to the same skeleton so they'll attach to the right spot.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 TheNut

    Senior Member

  • Moderators
  • 1718 posts
  • LocationCyberspace

Posted 27 August 2010 - 12:18 AM

Yes, the common way is morph targets. You typically clone the base mesh, as Reed put it, and apply a different characteristic. There are some optimizations involved, but that's the gist of it. You can then morph your base mesh to the target by altering the range from 0.0 to 1.0. In its basic mathematical form:

final.vertex = base.vertex + [Sum, 0, i]((target[i].vertex - base.vertex) * factor[i])
Note: You can optimize this by working only with the vertices you need to and also by precalculating the delta target values rather than working with the target mesh directly, thus eliminating a subtraction from the above.

Real-time implementations add morph targets rather than multiply them however, especially when there are many morph targets. The mathematical forumla above is an example of multiplicative blending, which is non-degenerative and slow (O(n)). With additive blending, you end up with the formula:

current.vertex += ((target.vertex - base.vertex) * delta)
- Where delta is the difference in target values. If your slider was at 0.5 and it moved to 0.6, the delta would be 0.1.
- Notice there is no summation here. It's all done "on the fly".

This is done for improved run-time performance (O(1)), but you risk quality issues when users recurrently alter character features that share vertices, often resulting in geometric goo (which I have seen in some games). To a smaller extent, floating point precision also plays a role, but can be virtually eliminated by using doubles. Some implementations fix this by linking targets so that advancing one feature may undo another, or several others. I'm sure you've seen some sliders retract as you advance another? Oblivion does this. It's not a sure-fire solution, but often enough to help prevent such cases.
http://www.nutty.ca - Being a nut has its advantages.

#4 mstam

    New Member

  • Members
  • Pip
  • 2 posts

Posted 27 August 2010 - 03:56 AM

Thanks a bunch, I'm off to try this out.

Have a nice day.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users