Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
3ds Max 6 Bible (2004).pdf
Скачиваний:
55
Добавлен:
17.08.2013
Размер:
50.02 Mб
Скачать

950 Part IX Dynamics

Using the Flex Modifier

The Flex modifier can add soft body dynamic characteristics to an object. The characteristic of a soft body is one that moves freely under a force. Examples of soft body objects are clothes, hair, and balloons. The opposite of soft body dynamics is rigid body dynamics. Think of a statue in the park. When the wind blows, it doesn’t move. The statue is an example of a rigid body. On the other hand, the flag flying over the library moves all over when the wind blows. The flag is an example of a soft body.

Another way to think of soft bodies is to think of things that can flex. Objects such as a clothesline flex under very little stress, but other objects like a CD flex only a little when you apply a significant force. The settings of the Flex modifier make it possible to represent all kinds of soft body objects.

Figure 39-9 shows many of the rollouts available for the Flex modifier.

Figure 39-9: The Flex modifier rollout lets you control the flex settings.

Flex subobjects

In the Modifier Stack, the Flex modifier has three subobjects that you can access: Center, Edge Vertices, and Weights and Springs. The Center subobject is a simple box gizmo that marks the center of the flex effect. Portions of the object that are farther from the center move a greater distance. The Edge Vertices subobject can be selected to control the direction and falloff of the flex effect. The Weights and Springs rollout controls the Weights and Springs subobject.

Chapter 39 Creating a Dynamic Simulation 951

Setting flex strength

The Parameters rollout includes a Flex value, which controls the amount of bending the object does; a Strength value, which controls the rigidity of the object; and the Sway value, which controls how long the flexing object moves back and forth before coming to a stop. An antenna on a car is an example of an object that has fairly high Flex and Sway values and a low Strength value.

Chase Springs cause an object to return to its original position when the force is removed.

A twig on a tree is an example of an object with Chase Springs. The Use Chase Springs option lets you disable these springs. A piece of cloth is an example of when you would want Chase Springs disabled.

Selecting the Weights and Springs subobject lets you apply weights to certain selected springs. You can disable these weights using the Use Weights option. If you disable these weights, the entire object acts together.

The Flex modifier offers three different solution methods to compute the motions of objects. These are presented in a drop-down list. The Euler solution is the simplest method, but it typically requires five samples to complete an accurate solution. The Midpoint and Runge-Kutta4 solutions are more accurate and require fewer samples, but they require more computational time. Setting the Samples value higher produces a more accurate solution.

Creating simple soft bodies

In the Simple Soft Bodies rollout, use the Create Simple Soft Body button to automatically set the springs for the selected object to act like a soft body. You can also set the amount of Stretch and Stiffness the object has. For cloth, you want to use a high Stretch value and a low Stiffness value, but a racquetball would have both high Stretch and Stiffness values.

Tip

You can manually set the spring settings for the object using the Advanced Springs rollout.

Painting weights

When you select the Weights and Springs subobject mode, the spring vertices are displayed on the object. The vertices are colored to reflect their weight. By default, the vertices that are farthest from the object’s pivot point have the lowest weight value. Vertices with the greatest weight value (closest to 1) are colored red, and spring vertices with the lowest weight value (closest to –1) are blue. Vertices in between these two values are orange and yellow. The lower-weighted vertices move the greatest distance, and the higher-weighted vertices move the least.

Selecting the Weights and Springs subobject also enables the Paint button in the Weights and Springs rollout. Clicking this button puts you in Paint mode, where you can change the weight of the spring vertices by dragging a paint gizmo over the top of the object in the viewports.

As you paint the spring vertices, they change color to reflect their new weight.

952 Part IX Dynamics

The Strength value sets the amount of weight applied to the vertices. This value can be negative. The Radius and Feather settings change the size and softness of the Paint brush. Figure 39-10 shows a dinosaur model with the Flex modifier applied. The dinosaur has had some weights painted so its tail, front arms, and neck move under the influence of the Flex modifier. The blue vertices are the weights that don’t move as much.

The weights applied using the Paint button are relative to the existing vertex weight. If you select the Absolute Weight option, then the Vertex Weight value is applied to the selected vertices.

Adding Forces and Deflectors

To see the effect of the Flex modifier, you need to add some motion to the scene. The flex object flexes only when it is moving. One of the easiest ways to add motion to the scene is with Space Warps.

The Forces and Deflectors rollout includes two lists: one for Forces and one for Deflectors. Below each are Add and Remove buttons. Using these buttons, you can add and remove Space Warps from the list. The Forces list can use any of the Space Warps in the Forces subcategory (except for Path Follow). The Deflector list can include any of the Space Warps in the Defectors subcategory.

Figure 39-10: Use the Paint button to change the weight of the spring vertices.

Chapter 39 Creating a Dynamic Simulation 953

Tip

When you add Space Warps to the Forces and Deflectors list for the Flex modifier, they do not

 

need to be bound to the object.

Manually creating springs

The final two rollouts for the Flex modifier are Advanced Parameters and Advanced Springs. The Advanced Parameters rollout includes settings for controlling the Start and End frames where the Flex modifier has an effect. The Affect All Points option ignores any subobject selections and applies the modifier to the entire object. The Set Reference button updates all viewports, and the Reset button resets all the vertices’ weights to their default values.

You can use the Advanced Springs rollout to manually add and configure springs to the object. Clicking the Options button opens a dialog box where you can select the type of spring to add to the selected vertices, including Edge and Shape Springs. Edge springs are applied to vertices at the edges of an object, and Shape springs are applied between vertices. For these advanced springs, you can set the Stretch Strength, Stretch Sway, Shape Strength, and Shape Sway.

Tutorial: Making a waving flag

A good example of a soft body object is a flag. By making a flag wave in the wind, you can practice using the Flex modifier. In this example, you also apply the Flex modifier to subobjects.

To make a flag wave in the wind using the Flex modifier, follow these steps:

1.Open the Soft body flex flag.max file from the Chap 39 directory on the CD-ROM. This file includes a simple plane object that has been converted to an Editable Mesh.

2.With the Flag object selected, open the Modify panel and select the Vertex subobject mode in the Selection rollout. In the Front viewport, drag over all the vertices except for the left column where the flag touches the flagpole.

3.With most of the vertices selected, click the Modifier List and select the Flex modifier (or you can choose the Modifiers Animation Modifiers Flex menu command).

4.In the Parameters rollout, set the Flex value to 3.0, set the Sway value to 50, and disable the Use Weights option. In the Simple Soft Bodies rollout, click the Create Simple Soft Body button. Finally, click the Add button for the Forces list in the Forces and Deflectors rollout, and select the Wind Space Warp in the Top viewport.

5.To see the final results, click the Play Animation button to see the flag wave in the viewport.

Figure 39-11 shows the flag waving.