Archived

This topic is now archived and is closed to further replies.

Fidelio_

Animated player models with clothing question

Recommended Posts

I''m thinking about programming a 3D game with players and NPC''s (bots), which should look relatively realistic (like sof2, mohaa, morrowind characters). What I am wondering is, suppose I make a human model, eg. in 3DS, how do I handle clothing ? They should not look painted-on like in older games, but have proper shapes. eg. an open coat should look like it does in Max Payne. Women should also be able to wear a skirt or dress, or a cape. Of course all clothing should be able to be combined, an open raincoat over a shirt and eg. combat pants with the side pockets underneath, combined with several models of shoes and boots. How is this generally done ? Making total human models of every combination seems too much work and too complicated. How is the clothing modelled and combined with the human body ?

Share this post


Link to post
Share on other sites
Well... make each piece of clothing a separate model. For each vertex in an article of clothing, you also want to sometimes include a little tag; ATTACHED.

If a vertex is ATTACHED, then it will never change position relative to the character''s model/skeleton. If it is not ATTACHED, then it "hangs" from it''s attached vertices. From there, it''s just cloth simulation. ATTACHED vertices are "fixed", or "sewn", while unATTACHED vertices are hanging from the ATTACHED and other unATTACHED vertices.

Now, of course, some clothing will have to be modified for very different person shapes... you''d need a trenchcoat for narrow shoulders, and a trenchcoat for wide shoulders... or, you could have the ATTACHED vertices reposition themselves relative to the shoulder bones of whatever model they get worn on.

Just my 1.517 yen.

Share this post


Link to post
Share on other sites
And the real bitch will be if you want to make sure the vertices that are free swinging don''t intersect solid body parts. I guess for that you''d have to check for radius overlapping of bone posiitons or perhaps other collision shapes built onto the bones. Could get slow and messy - especially if your clothing is very loose swinging - what if the long trenchcoat wearing character spins round quickly? The coat could get caught up on the wrong side of the character, get stuck between his legs, then as he attempts to walk, it would force intersection.

It''s going to a be a lot of trial and error to get it all right, but seriously, good luck. Realistic cloth in games can make a hell of a difference. I hope you pull it off.

Share this post


Link to post
Share on other sites
Don''t model the clothing as seperate objects. Just model any extra clothing geometry that sticks-out (coat tails, sleeve cuffs, flaired or baggy pant legs, skirts, etc.) right onto your base model... this will cut down on poly counts and prevent poke-thrus.

Give each peice of extra geometry it''s own unique surface material name, then you can switch these extra peices on and off in the game (depending on whether or not the particular character is wearing them). For any peice of clothing that doesn''t conform directly to the base character, you will need to rig with extra bones so it can be animated independently. As long as you animate the figure well, you shouldn''t run into any issues like Damocles was describing.

Hope this helps.

Share this post


Link to post
Share on other sites
quote:
Original post by SuperSpy
Don''t model the clothing as seperate objects. Just model any extra clothing geometry that sticks-out (coat tails, sleeve cuffs, flaired or baggy pant legs, skirts, etc.) right onto your base model... this will cut down on poly counts and prevent poke-thrus.

Give each peice of extra geometry it''s own unique surface material name, then you can switch these extra peices on and off in the game (depending on whether or not the particular character is wearing them). For any peice of clothing that doesn''t conform directly to the base character, you will need to rig with extra bones so it can be animated independently. As long as you animate the figure well, you shouldn''t run into any issues like Damocles was describing.

Hope this helps.


Share this post


Link to post
Share on other sites
quote:
Original post by SuperSpy
Don't model the clothing as seperate objects. Just model any extra clothing geometry that sticks-out (coat tails, sleeve cuffs, flaired or baggy pant legs, skirts, etc.) right onto your base model... this will cut down on poly counts and prevent poke-thrus.

Give each peice of extra geometry it's own unique surface material name, then you can switch these extra peices on and off in the game (depending on whether or not the particular character is wearing them).



Thanks, that looks about right. How can you model this efficiently ? EG long and short sleeves for a shirt, then various jackets, wouldn't this be a mess in eg. 3ds ?

And I am still wondering, support you make a nude model, put on a shirt, and a coat, how can you render eg. its back only as the polygons of the coat, and not draw 3 layers of polygons of which 2 are invisible ?





[edited by - Fidelio_ on September 9, 2002 10:19:38 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Fidelio_
Thanks, that looks about right. How can you model this efficiently ? EG long and short sleeves for a shirt, then various jackets, wouldn''t this be a mess in eg. 3ds ?



I''m not too familiar with 3DStudio, but in LightWave I use layers (much like in Photoshop) to keep my model organized until it''s all ready to be merged and exported.

quote:

And I am still wondering, support you make a nude model, put on a shirt, and a coat, how can you render eg. its back only as the polygons of the coat, and not draw 3 layers of polygons of which 2 are invisible ?



Well that''s the problem with doing it this way. Not only are you sending 3 layers of polygons to the renderer, but durring various stages of your animations you may have that layer of skin poking out through the outter layers. What you would need to do is break your nude model into various surface materials or groups which you can then "turn off" and not send to the rendering engine depending on what outer layers are worn.

Hope this helps.

Share this post


Link to post
Share on other sites
Do it morrowind style. Make each garment of clothing an individual object and then rig it up to a skeleton, and then when you''re rendering, use a pointer to the top level of clothing ( can be set when the character ''puts'' on the item of clothing ) to render only the top level of clothing?

This is a rough outline though, but it is how morrowind does it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by SuperSpy
Don''t model the clothing as seperate objects. Just model any extra clothing geometry that sticks-out (coat tails, sleeve cuffs, flaired or baggy pant legs, skirts, etc.) right onto your base model... this will cut down on poly counts and prevent poke-thrus.

Give each peice of extra geometry it''s own unique surface material name, then you can switch these extra peices on and off in the game (depending on whether or not the particular character is wearing them). For any peice of clothing that doesn''t conform directly to the base character, you will need to rig with extra bones so it can be animated independently. As long as you animate the figure well, you shouldn''t run into any issues like Damocles was describing.

Hope this helps.
Basically:
The clothing should share the bones of the body except for the free swinging stuff which should have it''s own bones. Make sure the path of the free swinging stuff doesn''t violate the chracter''s space and you should be fine.

Right?

I''m still seeing somesort of collision detection needed to make sure when the leg is all the way back in the stride, the coat tail doesn''t intersect the leg. Could you possible make sure that the bone''s distance from the point is never less than the bounding ellipsoid? Otherwise, extrude the point (or control point) along the vector normal to the point and the bone to the desired radius. (If you find the distance using the dot product method, you can easily get a point on the bone to form the vector needed)

I think you would have to do the collision stuff on the CPU and pass the final rotation/bezier patch as a constant into the vertex shader...If you use a bezier patch type system, you should be able to reduce the number of points tested for collision (although with an increasingly difficult test unless the control points were very heavily weighted) by simply testing the control points, then using the patch to determine the positions of the verticies for the clothing on the GPU...

Thoughts?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Basically:
The clothing should share the bones of the body except for the free swinging stuff which should have it's own bones. Make sure the path of the free swinging stuff doesn't violate the chracter's space and you should be fine.

Right?

Exactly.

quote:
I'm still seeing somesort of collision detection needed to make sure when the leg is all the way back in the stride, the coat tail doesn't intersect the leg.

Nope. If your leg intersects with the coat tail while you are animating the figure, simply adjust the coat-tail's bone and set a keyframe.

quote:
I think you would have to do the collision stuff on the CPU and pass the final rotation/bezier patch as a constant into the vertex shader...If you use a bezier patch type system, you should be able to reduce the number of points tested for collision (although with an increasingly difficult test unless the control points were very heavily weighted) by simply testing the control points, then using the patch to determine the positions of the verticies for the clothing on the GPU...

Much less overhead to use the human eye to detect collisions and work this all out while the character is being animated.


[edited by - SuperSpy on September 14, 2002 5:34:42 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by SuperSpy
Nope. If your leg intersects with the coat tail while you are animating the figure, simply adjust the coat-tail''s bone and set a keyframe.

I''m not an animator, but I seem to remember physics packages that are able to plugin to your animation tools and do some of the collision work for you.

Anybody else hear of these plugins (Havok?)?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
I''m not an animator, but I seem to remember physics packages that are able to plugin to your animation tools and do some of the collision work for you.
If you''re going to use a vertex interpolation animation system in your game that would work fine. However, if you''re going use skeletal animation, then you need to program that kind of functionality into your game, not the animation tool.

Plug-ins for cloth-like clothing and collision detection are great for animating characters for computer animated movies where your are working with millions and millions of polygons, but for game characters--even if they''re 5,000 to 10,000 polygons--it''s really not that difficult to manage. Keeping a leg from intersecting a coat-tail is just as easy as keeping the right leg from intersecting the left leg... just don''t animate it to do so.

Keep it simple.

Share this post


Link to post
Share on other sites