Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to collide the cloth with the character?
#2
(20-01-2018, 06:46 PM)panda_pajama Wrote: I want to have a loose skirt hanging from the waist of a character, and I want the animation of the character, especially the legs, to move the skirt from the inside.

It is not necessary for this to work in real time, as I will export the resulting animation for later playback in real time.

So I tried Option 1, which is to put an Obi Cloth in the skirt mesh, which locks the triangles in the waist very well, but I can't seem to correctly remove the bone influences so the rest of the cloth can move completely independent of the bones.

Then I tried Option 2, which is to have a non skinned mesh of just the skirt, as a child of the character pelvis. I then pin the vertices in the waist, and this gives a relatively good result, before collisions.

So now to add collisions, I first tried approximating the shape of the legs with capsule colliders, but either they're too thin, and the cloth intersects with the leg mesh, or they're too fat and the cloth bulges incorrectly.

Then I tried instead of capsule colliders, create an editor script that creates a small sphere collider at the center of each triangle in the leg mesh (remember I don't need this in real time), with a script that relocates the collider each frame to the skinned position of each triangle, but for some reason the cloth seems to completely ignore the colliders.

For most accuracy, I also tried creating mesh colliders, one for each triangle (as a prism to ensure the resulting mesh is convex), and updating them to relocate the resulting mesh each frame. Again, the cloth seems to ignore the colliders.

What would be a good way to achieve my goal of having the cloth pushed by the legs in the inside?

Option 1 is your best bet. Increase the particles' "skin radius" value to ensure they are not too heavily influenced by the bone animation. See:
http://obi.virtualmethodstudio.com/tutor...aints.html

You can also combine it with regular colliders (capsule or sphere colliders) to ensure proper behavior. Make sure that the collision layers/phases are properly set up:
http://obi.virtualmethodstudio.com/tutor...sions.html

Also remember that by adding a ObiParticleRenderer component to your cloth, you can see the particle representation used for cloth collisions. This is very useful to tune/debug collisions:
http://obi.virtualmethodstudio.com/tutor...ering.html

Anyway, how do you plan on exporting the animation afterwards? keep in mind that Obi does not include any import/export functionality for cloth animation, so you will have to roll your own. Imho, a much better/faster workflow for animated cloth is to simulate the cloth using an offline-sim (Maya's nCloth, Blender's cloth, etc) directly inside your 3D animation package, then export that. Obi cuts a lot of corners to achieve realtime performance, so the cloth simulation quality obtained from a non-realtime simulator will always be much higher.

Since you're exporting it anyway, I see no reason to use a realtime simulator for this -unless you intend your application/game to include both the baking and the playback parts of the pipeline (that is, allow your users to bake their own simulation and then play it back)-

cheers!
Reply


Messages In This Thread
RE: How to collide the cloth with the character? - by josemendez - 20-01-2018, 07:23 PM