Drawing Back the Curtains
Hi, everyone, Lynda.com and Infinite Skills author Joel Bradley here with a quick tutorial that walks us through the process of modeling a simple set of tied-back curtains using some of 3ds Max’s Cloth Simulation tools, specifically the Cloth modifier itself.
Setting Up the Project Folder
To be able to follow along with the steps we will take here you will need to download the supplied project files from this link: www.vrayelite.co.uk/AugiWorld/Project_Files.zip.
Once you have the zip file download you can then extract the contents of the archive to a local or portable disk location of your choice. Just be sure to make a note of where you put them as you will need to navigate to the root folder in just a moment or two.
Once extracted, we can now fire up Autodesk® 3ds Max® to set up and make use of the 3ds Max Project structure provided in the download. To do that, let’s:
- Come up to the customize menu at the top of the 3ds Max UI and from there open up the ‘Preference Settings’ dialog.
- Inside there we want to first switch over to the Files tab, and then make sure that the ‘Convert local file paths to relative’ option has a check mark in it.
- Finally, click Ok to save the changes and exit the dialog.
Enabling this option makes sure that any files you may want to add to the project from this point forward will be given file paths that are relative to the project root, as opposed to being given hard-wired local paths.
Now we are ready to set up our 3ds Max project folder. To do that, we:
- Come up to the Quick Start toolbar found in the top left corner of the 3ds Max UI and there click on the ‘Project Folder’ icon.
- In the ‘Browse For Folder’ pop-up that appears we need to navigate to the Project_Files folder that we extracted to disk a few moments ago.
- Once located, all we need to do in order to set this as the Project folder is left mouse click to select and highlight it and then click OK to lock that selection in place, dismissing the ‘Browse For Folder’ dialog at the same time.
Figure 1: Project Folder button in Quick Start menu
Overview of Our Start Scene
With the Project Folder correctly set up we can now open up the 3ds Max scene file with which we will start our tutorial. To do that:
- Come back up to the Quick Start toolbar and this time click on the ‘Open File’ icon. This will take us straight to the ‘scenes’ folder located inside the Project structure.
- In here, left-click to open up the ‘Curtain_Start.max’ scene file.
If you now scrub the time slider down at the bottom of the 3ds Max UI, you should be able to see that we currently have three animated boxes in the scene, each of which contracts along its own local X axes as time moves forward. These are the objects that we will eventually be using as ‘cloth driver’ objects that will essentially pull our curtains into place for us.
We also have two simple geometry planes in the scene, one will serve as our curtain whilst the other will be used to create a pelmet that in real life would hide the rail or pole upon which the curtain hangs. Here we will use it to disguise the fact that we have no rail or pole geometry in the scene.
You will also notice if you select each of them in turn that these planes have quite high polygon counts. This is by design as it will help us produce better deformations in the geometry once we start to simulate and fold the curtains.
If you have used 3ds Max’s cloth tools before, perhaps having worked through a number of tutorials already, you may be wondering why we are keeping Quad subdivisions in the meshes rather than using the more often recommended Delaunay triangulation pattern. We are doing so in this instance because quads actually give us better final deformations than would come from the triangulated mesh of modifiers such as ‘Garment Maker/’ The uniformity of the quads just seems to help the curtains fold in a more interesting manner.
And finally we are using the Iray renderer in the scene so that lighting and sampling turn out at fairly decent quality levels without us having to worry about parameters and settings. Of course, the render times we get may well be longer than desired, especially if we follow a workflow that requires us to make a number of test renders throughout a project. As we will only be taking one or two renders here though, this set up should work out fine.
With the set up out of the way, let’s make a start at creating our Cloth objects, working first with our curtain geometry.
Turning the Curtain into a Cloth Object
The first thing we will need to do, of course, is turn the curtain into something that 3ds Max can recognize as a cloth object for simulation. To do that, we:
- With the GEO_Curtain object selected, come over to the Modify tab in the Command panel and from the modifier drop-down list apply a Cloth modifier.
This instantly makes a wealth of commands available to us in the Command panel—an extremely important one being the ‘Object Properties’ button. In order to access the controls that give us the ability to assign specific cloth properties to our geometry, we need to:
- Click the ‘Object Properties’ button which will open up the Object Properties panel.
- From the ‘Objects in Simulation’ list on the left, we can select the GEO_Curtain object and then from the very top of the parameter section right-click the ‘Cloth’ radial button. This tells 3ds Max that we want to count this particular object in the simulation as Cloth.
- From the ‘Cloth Properties’ presets list found in the drop-down just below, choose the ‘Cotton’ option and then lower the U&V Compress values to 50 (these should be linked by default) to help give us more realistic folds in the material.
- We also want to add a little more density to the cloth to help it hang a little better, so let’s increase that parameter from 0.01 to 0.02.
Figure 2: Object Properties dialog
As we already have a scene set up using geometry to represent real-world solid objects such as the walls, we will need to tell 3ds Max that these need to collide with the cloth inside the simulation. To do that, while still inside the Object Properties dialog, we need to;
- Click the ‘Add Objects’ button found just above the ‘Objects in Simulation’ list, and from the ‘Add Objects to Cloth Simulation’ dialog that appears, select the GEO_Room and GEO_Window_Sill objects, and then then click the Add button.
Now, although our two objects look as though they are currently selected in the ‘Objects in Simulation’ list, this is a bit of a bug in 3ds Max that is trying to kid us, so before making any changes we just need to de-select and then re-select them both. We can easily tell when we have them correctly selected as the ‘Inactive’ radial button becomes selected.
- Next, we need to click the ‘Collision Object’ radial button found down at the bottom of the Object Properties dialog and then enter an ‘Offset’ value of 0.35.
- To finalize the settings we have entered, click the OK button at the bottom of the dialog.
NOTE: Be sure NOT to click the X in the top right corner of the dialog as this will effectively cancel everything that we have done and lose the settings.
Linking the Curtain to the Driver Objects
With the object types correctly added to the simulation, we can now set about linking our curtain geometry to the animated driver objects in the scene. To do that, in the 3ds Max command panel, we:
- Expand the Cloth modifier at the top of the modifier list using the + button found just before its name and from the options select ‘Group’ sub-object level.
- As we need to get a clear view of things here let’s hit the F key to switch over to a front view and then press F3 to make use of wireframe mode in the viewport.
- To get nice and close to the action we can select the Zoom Region tool from the controls in the bottom right of the 3ds Max UI and in the viewport, draw a region around the animated driver object (box) found at the top of the curtain.
- After right clicking to exit the Zoom tool, make certain that the selection method is set to ‘Rectangular’ and then click and drag to make a rough selection of all the curtain vertices that sit within the visible volume of the driver (Box) object as seen in Figure 3.
Figure 3: Selected verts
- Back over in the Command panel, we now need to click the ‘Make Group’ button found in the Group rollout, giving it a name in the ‘Make Group’ dialog that describes what the group is doing. ‘Top_Node’ should do nicely here, and then once we are done we can click Ok to exit.
We now have an unassigned group (as seen in the group list window), which means that it currently has no behavioral instructions attached to it. To alter this we need to:
- Click the ‘Node’ button from the options that have now become active in the Command panel and then click in the viewport to select the GEO_Top_Cloth_Driver object. (You will now see driver object’s name appear next to the group in the list window.)
NOTE: Alternatively, having clicked the ‘Node’ button we could hit the H key and then select the driver object from the Pick Object dialog that appears.
Of course we now need to follow through and use the same basic procedure for the cloth driver object that is positioned at the midpoint of our curtain. To do that, let’s:
- Re-position our view by means of middle mouse click and drag, making certain that we place the ‘GEO_Mid_Cloth_Driver’ object at around about the middle of the view.
- Again we need to make a selection of vertices inside the volume of the driver object, but as this geometry is at an angle in the view, we will need to switch our selection tool and use either the ‘Fence’ or ‘Paint’ Selection options.
- In my case I am going to switch over to the ‘Paint selection’ tool and then use it to create the selection seen in Figure 4.
Figure 4: Selected mid verts
If you get a bit carried away with the selection you can always hold down the Alt key and then paint to de-select certain vertices.
- We do need to turn our selection into a Group, so again let’s click the ‘Make Group’ button over in the command panel, name it ‘Mid_Node,’ and then click OK.
- To apply the required behavior to the new group we need to click the ‘Node’ button and then in the viewport left click to select the ‘GEO_Mid_Cloth_Driver.’
- Finally, up in the modifier list left-click on the top level ‘Cloth’ label in order to exit modifier sub-object mode.
Setting the Options and Simulating the Cloth
Now we need to apply the final set of parameters that will allow us to simulate our curtain into place. To do that:
- Still in the Command panel, scroll down in the Cloth modifier parameters to the ‘Simulation Parameters’ rollout and from there increase the Subsample value to 3 to improve the accuracy of our curtain simulation.
- As we are folding the cloth in on itself, we will also want to put a check in the Self Collision option and set its numeric value to 1.
Figure 5: Final simulation parameters
NOTE: If you are wondering why we aren’t also enabling the ‘Check Intersections’ option, the simple truth is that this feature is discontinued and so no longer functions in a newly created simulation such as this.
- We also need to ensure that ‘Gravity’ is enabled and set at an Earth actual value of -980cm (-9.8 if working meters).
- Finally, we can come back up to the top of the rollout, hit the ‘Simulate’ button, and then wait for our curtain to be drawn into place. (You may want to hit the C key and switch back to the Camera view here to watch this progress.)
Once the simulation has run its 300-frame course, because we are only looking to create static curtain models here, we can use some very simple 3ds Max functionality to create a matched pair.
- From the Tools menu, use the ‘Snapshot’ tool with the ‘Single’ and ‘Mesh’ options chosen to create a static copy of our mesh in its current form.
- Next we drag the time slider back to around frame 275 (adding a little bit of variation to the way our cloth looks) and again use the Snapshot tool, giving us two static pieces of curtain geometry.
- To tidy up the scene somewhat, let’s either right-click on the still selected simulated curtain and then use the ‘Hide Selected’ option from the quad menu, or simply delete it from the scene.
NOTE: If we simply hide the mesh, then our cached cloth simulation will be saved with the 3ds Max file, bumping up both its size and load times by quite a bit. In my case, I am going to delete it from the scene in order to keep files sizes down.
To place one of our curtains over on the opposite side of the window:
- Select one of the snapshot meshes in the scene and from the main toolbar click on the Mirror tool.
- We can set to the mirror axis in the pop up dialog to X, choose ‘No Clone’ from the Clone Selection options, and then in the Offset field set a value of around about 71cm in order to nicely separate the two curtains.
NOTE: If desired we could at this point add a shell modifier to give the curtains some thickness for this demonstration, though we will forgo that step and instead select and hide our animated driver objects and come up to the main toolbar and hit the Render button.
Figure 6: Curtains in final simulated position
Turning the Pelmet into a Cloth Object
Turning our second geometry plane into a Pelmet requires following a set of steps that are pretty much identical to those used in the creation of our curtain. The only noticeable difference will be the way in which we select and group our vertices for attaching to the animated driver.
- With the Pelmet plane selected, let’s come over to the Modify tab and from the drop-down list, apply a Cloth modifier.
- In the ‘Object’ rollout, click the ‘Object Properties’ button, select the ‘GEO_Pelmet’ entry from the list on the left, and then click to select the ‘Cloth’ radial button.
- From the ‘Presets’ drop-down we can again choose the Cotton option and lower the U&V Compress values to 50 to help achieve better deformation in the cloth.
- Once done, click the OK button to finalize the settings and dismiss the dialog.
As the Pelmet geometry is nowhere near the wall (being moved into place by hand once the simulation is done), there is no need for us to add any collision objects to this particular simulation.
Linking the Pelmet to the Driver Objects
To link vertices in the Pelmet geometry to the driver object:
- In the modifier list, access the cloth modifier’s sub-object options via the + button and select ‘Group’ sub- object level.
- Again, we will probably want to make sure that we are in a front view so let’s hit the F key to switch over to that and at the same time use F3 to ensure that we are in wireframe mode.
- Now we can Zoom in and Marquee select the first two vertices of the top row, come over to the command panel, and from there click the ‘Loop’ button found in the ‘Group’ rollout.
Figure 7: Selected top row verts
- From the top we want to count roughly 7 to 10 rows down and then, whilst holding down the Control Key (which we need to keep down for the rest of this selection operation), again select the first two vertices in a row and then click the Loop button. You should end up with a selection that looks something like Figure 8.
Figure 8: Double row selected verts
- Next we need to select some vertical columns, doing so roughly every 9 to 13 vertices along.
NOTE: Although we want the selection to come close to the already selected second row of verts, it is better if they don’t actually connect up AND if the number of vertices in the column is varied. Once done we should end up with a selection that looks like Figure 9.
Figure 9: Selected verts
This selection pattern has been used to help us create a much more complex set of folds than was needed for the initial curtains.
- Now we can click the ‘Make Group’ button in the Command panel Group rollout and give it the descriptive name of Ruffle_Node, clicking OK once we are done.
Again we now have an unassigned group.
- To assign a behavior we can click the ‘Node’ button and then select the GEO_Pelmet_Driver object in the viewport (or again use the H key to pick the geometry from a list).
And with that we have now set up our Pelmet. All that remains is to:
- Exit sub-object mode on the cloth modifier and then click the Simulate button in the Command panel’s ‘Object’ rollout.
NOTE: Even though the Pelmet plane is less dense (in terms of polygons) than our curtain geometry, because the selection we are using is much more complex we can expect this simulation to take quite a bit longer previous. Ultimately, the end result should be well worth the wait.
Final Touches to the Pelmet
Typically a Pelmet has a front and two sides, effectively boxing off the curtain pole or rail. To save ourselves a little time and to reduce the complexity of the simulations we are working, we have quite obviously been working with just a single flat plane to create our Pelmet.
To fake the box effect somewhat we can perform some simple modeling operations on the pelmet geometry and bend each of the ends into place9. To do that let’s:
- Take a snap shot of the Pelmet and then delete the simulated object from the scene.
- Before performing modelling operations I like to convert my geometry to an editable poly by right clicking and choosing the Convert > Convert to Editable Poly command.
NOTE: This is just a personal preference not an essential step, we could just as easily add an Edit Poly modifier to the geometry and then perform the following operations from there.
- Next we want to switch to a Top view so let’s hit the T key to do that and at the same time make sure that we are in wireframe mode using the F3 key
- Let’s enter ‘Vertex’ sub-object mode and then marquee select 3 to 5 rows of vertices on the far left of the Pelmet object as shown.
Figure 10 – Selected Verts
- In the ‘Soft Selection’ rollout we need to first of all enable ‘Soft Selection’ and then set its ‘Falloff’ radius to 7cm.
- With the Rotate tool active, rotate the selected vertices roughly minus 70 degrees on the Z axis, essentially bending them round the corner.
- Of course, we need to perform the same operation over on the opposite side of the Pelmet so let’s select a group of vertices over on the right hand side of the geometry and this time rotate them around the positive Z axis.
- Finally, let’s move our Pelmet into place using the ‘Move’ tool, setting it just above our curtain, and then finish off by taking a final render. The end result should look like something like Figure 11.
Figure 11: Final render
And with that, we are done. The idea here has been to introduce you to a basic methodology for creating a set of curtains using 3ds Max’s Cloth simulation tools. The next step is for you take what we have covered here and experiment with both the settings and the technique to produce something unique and wonderful of your own.
Joel Bradley is a self-taught 3D generalist who has been using 3D and graphic design applications since he was 9 years old, cutting his teeth on programs such as truespace and bryce 3d before moving onto 3ds Max. He has used his acquired skills to work in a number of industry areas including producing content for the web, print, visualization, and multimedia, to name a few. For the past four years, Joel has focused his attention on the production of video training for applications such as 3ds Max, Maya, SketchUp, V-Ray, Photoshop, After Effects, Combustion, Composite, and others.