**Note** This tutorial is based off of Chapter 2, Maya Cloth for Characters!
Pre-requisite: Solid understanding of the Maya interface.
- Cloth sheet
- Polygon mattress
- Polygon Box spring
Overview: In this example, we create a polygon sheet utilizing cloth’s create panel and create garment tools, and rest the sheet on a bed.
1. We start with an established scene of a polygon mattress and box spring. You can use primitive cubes or any basic piece of geometry. Make sure the edges are rounded, however. Cloth snags on sharp corners. Add the objects to a layer and set the layer to “T”, for template.
2. To build the sheet, use curves to form a closed loop and allow Maya to generate triangulated geometry for us. Go to a the top view. Using the CV curve tool, set to a linear curve type, draw four curves in the shape of a rectangle, with “snap to grid” turned on. After drawing all four curves, select them and raise them about one unit above the mattress. Make sure they remain planar. Only curves residing in the same plane are considered valid.
3. Next, select each curve in contiguous order. Choose Cloth > Create Panel. The panel icon is created.
4. With the panel icon selected, choose Cloth > Create Garment. The geometry is generated. It should look similar to figure 4. Normally, you would take one look at this geometry and delete it before it spread its ugliness to the rest of your models. However with cloth, “irregular” geometry is good. In fact, normal, “regular geometry”, the stuff we strive so hard to perfect, is bad.
5. Select the geometry. In the channel box, notice an input named cpStitcher. Click on it to open its parameters. Change the Base Resolution to a value that yields a triangle count of around 5000. Start with small increments of around 50, so you don’t overload your computer. It is set to 750 for this example.
6. Change to a perspective view. Run a local simulation by choosing Simulation > Start Local Simulation. At this point, the cloth falls into infinity. Choose Simulation > Stop Local Simulation and then choose Undo. The sheet is not colliding against the mattress. Select the mattress and box spring. Choose Cloth > Create Collision Object. In the channel box, change the Collision Offset and Collision Depth to .1.
7. Run the local simulation again. This time the cloth collides against the mattress, but the deformations rapidly deteriorate and the sheet starts to fall off.
The problem is the Solver Scale. To determine the correct solver scale, you must know the scale of which you are working in. For instance, Maya’s units by default are in centimeters. The scale for this tutorial is 1 cm in Maya = 1 ft in the real world. Applying this to our cloth sheet gives us a length of 8 cm in Maya and a real world equivalent of 244 cm (8 ft). Divide the Maya units by the real world units. 30.5 is the result and our new solver scale. Run the local simulation again with new solver scale.
The cloth sheet now relaxes nicely onto the mattress. Choose Simulation > Stop Local Simulation. This time do not hit undo. If you are happy with the results choose you can now start animating other objects in the scene. From here on it the cloth is cached through the time slider.