3d model clothing programming

Started by
1 comment, last by C3rial 12 years, 6 months ago
Hi!

I'm making a game where I'd like to have the user able to change clothes
on the main character model.

How do I best go about this?
The clothes will of course have to move like the character moves.

I'm guessing one approach would be to properly map up and name the vertices (with prefixes) of the e.g pants,
and maybe programmatically have the different bones give weight to the vertices?
I've animated the character model with bones.
But this sounds very messy to me.

There has to be some easy (generic) way of making this simple in 3ds max, which I've made the model in?

Maybe programmatically make the different vertices move according to their closest vertex from the player object?
Leaves a lot of room for error...?

Thanks for your replies! :)

-C3rial-
CrazyPoly
Advertisement
In games this is mostly done by creating different models, like some new pants, which are skinned to the same skeleton.
You basically update the transformations of the bones of the character representing the pants with the main skeleton's transformations for those same bones.
And you then render a collection of these clothing items.

Often a higher level system is built on top of that, to determine which clothing items are overlapping others, so that they can be removed.
For example a t-shirt below a jacket might not be visible as you only see the jacket.

So basically its very simple, just copying over the bone transformations of the main character to the same bones in the clothing items.

Of course you can go more complex as well, if you want to prevent specific triangles in some pants penetrating the boots the character is wearing.
So you could also introduce clip planes to clip the pants mesh so they dont go through the boots, etc. But 99% of the games don't do such thing

So to summarize, you do this:

1.) Update main skeleton, which has no meshes, or just a naked body.
2.) For all clothing items, copy the bone transforms of the main skeleton to the specific clothing item
3.) Render all clothing items using those new transformation matrices for their bones.
Awesome!

Thanks for your reply!

Sounds like a reasonable approach!
I'll try this!
CrazyPoly

This topic is closed to new replies.

Advertisement