Rendering Thick Cloth Objects

By -
Duration
3 mins
Last modification: 16 Sep, 2017

With nCloth it is simple to give the cloth a specific thickness for simulation. However one may also wish to render the cloth showing the thickness. In general it is much preferable to simulate on a simple flat cloth object with thickness then add construction history downstream to turn the flat cloth into a thick 3d object.The following technique can be used not only to add thickness to garments, but also to create more complex 3d objects, thick rubber slabs and gumby-like characters. Lets start out creating a simple cloth plane falling on a colliding cube: 1. MENU "Create: Polygon Primitives: Cube" 2. MENU "nCloth: Create Passive" 3. MENU "Create Polygon Primitives: Plane" Position the plane above the cube 4. MENU "nCloth: Create nCloth" In the attribute editor for nClothShape1 make the thickness 0.1 and set solver display to "Collision Thickness". (The solver display is for feedback only and does not render)

When you playback the cloth should collide with correct thickness for the top of the cube. Note that the cube nRigid node also has some thickness... you can make this zero if desired, but be careful that the cloth width is never zero, as currently it can lead to bad collisions when the total collide width between two objects is zero. Note that with thick cloth the behavior is somewhat different because the self collision with thickness makes the cloth somewhat less compressible and also restricts bend angles. This is usually desirable, but you probably want to make sure that the selfCollideWidthScale is not greater than one. The "Vertex" selfCollisionFlag works the fastest for very thick cloth, although on occasion you may need to use "Full Surface" for better quality. Now lets thicken the rendering of the cloth to match the simulation thickness. 5. Select the cloth plane. 6. MENU "Polygons: Edit Mesh: Transform Component" Move the mesh down to the bottom of the thickness display (polyMoveVertex:local translateZ = -0.1)

7. Go back to object selection mode (the cloth plane should be selected) 8. MENU "Polygons: Edit Mesh: Extrude" Drag the extrusion to the top of the plane (polyExtrudeFace:localTranslateZ = 0.2) Turn on "Keep Faces Together" on the polyExtrudeFace node.

If you turn off the thickness display and run the simulation a bit it should look as follows:

You now have a rough match for the collision thickness to render, but the edges are square. A bevel or a smooth operation will round the corners if desired. For many cases this will be sufficient, but for large thicknesses one may wish to match the effect of added width along border edges. This can be done by adjusting the above workflow as if for a thinner object, then doing a smooth on the surface followed by another "Transform Component" to offset the smoothed surface: 9. Edit polyMoveVertex1: set localTranslateZ to -0.01 10. Edit polyExtrudeFace1: set localTranslateZ to 0.02 Also set the divisions to 2 for more resolution around the edge. 11. MENU "Polygons: Mesh: Smooth" 12. MENU "Polygons: Edit Mesh: Transform Component" Drag the manip away from the surface until the thickness matches (polyMoveVertex:local translateZ = 0.1)

The resulting effect is that the surface offsets outward not just along the normal but also thickens away from border edges. Note that one could have used a bevel instead of a smooth, although in general it is nice to have the smoother surface.

editPfxOnPolyPath.mel parentToSurface.mel nClothBook.ma dynamicFollow.mel cameraFollow.mel cameraFollowScene.ma lightOcclusion.ma fireball.ma itsSlinky.ma TunShu_BindClothSkin.zip confettiFall.mb simpleConfetti.ma roundConfetti.ma partyStreamers.ma waterTank.ma nClothWater2.ma nClothWater.ma waterPlayground.ma sunsetLeaf.zip oakBigLeaf.mel + oakBigLeaf.mel.icon ribbonTwist.ma bagOfMarbles.ma toonOcean.ma buckySphere.ma thickSlab.ma
Posted By
Published In
Tags
  • nCloth
3 Comments
To post a comment please login or register
| 11 years ago
Hi Duncan, THe only problem I had with this technique is that I needed to pin the base geo AND the extruded geo's verts to another object with constraints. It only seemed to accurately constrain the un-extruded verts. I'm guessing because the extruded verts are downstream to the Ncloth?
| 12 years ago
The thickness here is provided by the built in cloth thickness attribute, and larger thickness values can result in longer collision computation times. The rendered thickness is downstream of the cloth, and does add a fixed overhead, but this will generally not be too bad unless you have high smoothing subdivisions. Being a render effect, the thickness does not have any dynamic or internal volume preserving qualities. If you instead modelled the thickness upstream of the cloth, then you could make it like an air filled bladder by using the volume conserving pressure method. Note however that solving on the extruded surface will be more than two times slower, due to twice the vertices and the added layer of self collisions. It would be even slower if you solved on the smoothed surface( it's generally best to keep the smoothing downstream of the cloth ). Duncan
Hi Duncan, Thanks so much for writing this tutorial on thick cloth. It's a fantastic look into how to achieve this goal. Does the upstream history from the nCloth node add a lot of computational overhead? Also, it one modeled clothing with thickness, would the solver act like it was a balloon, complete with an internal pressure? Best, Jacques
*Save $66 per month on Autodesk's Suggested Retail Price (SRP) when purchasing 1 year term 3ds Max or Maya subscription.