Simulating Flag Ripples Using Flex In 3D Studio MAX

By Aziz | 3D Studio Max | Intermediate

This tutorial will teach you how to create a realistic looking flag ripples effect against wind using the Flex modifier. The Flex modifier could be used for simulating soft body dynamics to create, for example, realistic looking skin and cloth. This is an intermediate level tutorial, you are expected to know the basics of 3D Studio Max before attempting this tutorial. Here is a sample of the end result that we shall create by the end of this tutorial.

Starting Off - Creating the Flag Pole

In a new 3DS document, start off by creating a plane in the front viewport as illustrated in the image below.

Create a poll for the flag, check the image below for an example.

Creating the Forces and Modifying the Mesh

Go through Geometry>Space Wraps>Forces and select Wind and then place the wind source to the position shown in the image below.

Select the flag and access the Modifier Panel and then pick from the drop down menu Mesh Select as illustrated in the image below.

Expand the Mesh Select rollout, click the Vertex icon and then select all the vertices except for the last column next to the poll.

While the vertices are selected, access the Modifier List drop down menu and select Flex as illustrated in the image below.

Now that Flex is selected, access the Force and Deflectors rollout, click on Add and then select the wind we created on the scene as illustrated in the image below. That should make wind get added to the forces.

Expand the Flex rollout and then highlight Weights & Springs. This shall alter the colors of the flag vertices to give a visual indication of the force effect of flex on the plane where the red vertices are under full force and the blue ones are outside the force field.

While Flex is still selected, scroll down to Advanced Springs and check the box for Show Springs. Now access the Edit menu and select Hold.

Tip: Hold allows us to get back to a certain point of time without using the Undo command. This is a great way to experiment with new operations and a great way to undo actions that cannot be undone using the normal way.

The plane is now almost done. We need to convert it to a soft body to react with the forces on the scene, and in our case flex. Access the Simple Soft Bodies rollout and click once on the Create Simple Soft Body as illustrated in the image below.

Access the Advanced Springs rollout and uncheck Show Springs. Access the parameter rollout and uncheck User Chase Springs as illustrated in the second image below.

You can play the animation now to see that it runs as a flag animation, but it is not smooth enough. We are going to enhance this some more now.

Access the Simple Soft Bodies rollout and change the settings as illustrated in the image below. You will then have to select Wind and again change the parameters to match the ones in the image below.

The wind does not usually flow in a single direction, we are going to simulate this effect by animating the wind with rotation. To do this you will have to turn on the Autokey and then move the time slider to frame 30 and rotate the wind on the Z-axis about 35 degrees. You will then have to move the time slider to frame 100 and rotate the frame 45 degrees to the other direction.

We now need to add Sdeflector, a tool that helps the flag avoid self-interpenetration. Sdeflector could be added by going through Geometry>Space Wraps and then selecting Deflectors from the drop list and then SDeflector from the object rollout. Click once to place it on the scene, and then drag the mouse to set its size. Select the flag, and then head over to the Modify tab and access the Flex Modifier, scroll down to the Force and Deflectors rollout and click on the Add button. Finally select SDeflector from the scene to add it to the Deflectors list as illustrated in the image below.

While the flag is still selected, access the Modifier List and select the Point Cache modifier. Make the changes illustrated in the image below.

The Point Cache Modifier enhances performance by saving vertex positions on disk file to save resources during the computation required for modifier animation.

While Point Cache is still selected, hit the button labeled Disable Modifiers Below under the Parameters rollout as illustrated in the image below.

You can now hit the play button to view your animation.

This concludes our tutorial, I hope that you learnt something from this tutorial, you can view end scene to see the actual file I used. If you have any comments or suggestions please feel free to email me or to post at the Oman3D Forum.

- End of Tutorial