Chapter 38: Animating Hair and Cloth


The specialized hair and cloth systems can create believable, realistic hair, but the real benefit to making hair and cloth come alive is found in the dynamic abilities of both.

In this chapter, we look at the dynamic abilities of both the hair and cloth systems. Using these systems, you can simulate hair that is blown by the wind and cloth that drapes over and around underlying objects.

CROSS-REF 

Creating and defining both the Hair and Cloth systems is covered in Chapter 19, "Adding and Styling Hair, Fur, and Cloth."

Using Hair Dynamics

Being able to style hair is great, but have you ever left the barbershop and had the wind do its own styling job on your hair? The Dynamics rollout for Hair and Fur lets you define specific forces and let the hair fall where it may.

Tip 

Be conservative with the forces that are applied to a hair system. Too many forces or too extreme forces can easily destroy any styling that you've created.

Making Hair Live

The Dynamics rollout is available only if the Hair and Fur (WSM) modifier has been applied to an object. At the top of the Dynamics rollout are three modes: None, Live, and Precomputed. If you select the Live mode, then the hair around the growth object immediately becomes subject to gravity and other forces in real-time, causing the hair to droop about the growth object. Moreover, if you move the object within the viewport, the hair flows about the object as if you were moving a real object with hair attached. Figure 38.1 shows a simple mouse with hair attached. The image on the left shows the hair particles with the None mode enabled and the image on the right shows the hair after the Live mode is enabled. Notice how the hair particles fall around the mouse object.

image from book
Figure 38.1: The Live dynamic mode makes the hair react in real time to the scene forces.

If you press the Escape key while in Live mode, a dialog box appears, giving you the option to Freeze, Stop, or Continue. If you choose the Freeze button, then the hair stays in its current position.

The Precomputed mode is available only after you've specified a Stat File name. This mode lets you save the hair motions into a separate stat file.

Setting properties

Only a few properties need to be defined to enable hair dynamics. In the Dynamics rollout, you find values for Gravity, Stiffness, Springiness, Root Hold, and Dampen. These properties control how the hair behaves in response to the environment forces. The Gravity value can be negative if you want the hair to rise instead of fall. You can simulate space environments by setting the gravity to 0. The Stiffness value eliminates all dynamic movement if set to 1.0. If you want the hair to move only slightly as the object moves, then a Stiffness value close to 1.0 should work. The Root Hold value is like stiffness, but applies only to the root. The Dampen value causes motions to die out quickly.

All dynamic properties except Gravity can be controlled using a grayscale map, using the small button to the right of the value field.

Enabling collisions

The first type of dynamic force to address is to enable collisions between the hair and the other scene objects. To enable collisions between the growth object and its hair, simply enable the Use Growth Object option. In addition to the growth object, other scene objects can be added to the list with which the hair will collide. To add other objects, click the Add button and pick the object to add in the viewport. Each collision object can use either a boundary Sphere to define its collision volume or a Polygon, which bases collisions on the actual surface geometry. The latter takes longer to compute, but it's more accurate.

Enabling forces

In addition to the ubiquitous gravity, you can enable collisions between the hairs and the growth object and any other scene objects. To add another scene object to the collision calculations, click the Add button and select the new collision object. The External Forces list lets you add Space Warps for additional forces such as Wind.

Running a simulation

The Precomputed mode lets you save the hair dynamics to a separate stat file. If you want to capture the dynamic simulation, you first must specify a stat file by clicking the button to the right of the Stat File section. With a stat file specified, click the Run button in the Simulation section to calculate the dynamic solution. The Start and End fields let you enter the range for the simulation. A separate stat file is generated for every frame of the animation.

If you enable the Precomputed mode option before you render, then the stat file is read and used during the rendering process. You can delete all stat files quickly with the scarily named Delete all files button.

Tutorial: Simulating hair dynamics

Dynamic hair moves and flows around the other objects in the scene that are animated. As an example of this, we move a female character's head back and forth and simulate how the hair moves. I selected the Mohawk hairstyle because I'm hip and cool, a real rebel. Actually, the Mohawk is a simple style and gives us a chance to play with the Stiffness property.

To simulate the dynamics of a hair system, follow these steps:

  1. Open the Female head.max file from the Chap 38 directory on the DVD.

    This file includes the head from a female character model created by Zygote Media. The hair modifier already has been added to this character and styled.

  2. Click the Auto Key button, drag the Time Slider to frame 5, and move the character to the right in the Top viewport. Then drag the Time Slider to frame 10, and move the character back to the left. This simple motion should be enough to bend the hair over. Then disable the Auto Key mode.

  3. With the head selected, open the Dynamics rollout and set the Stiffness value to 0.8. This should keep the hair standing straight up. To check this, enable the Live mode and watch how the hair reacts.

  4. Set the Simulation to run from 0 to 10 frames, and then open and specify a stat file location. The path of the stat file location is displayed. Then click the Run button to start the simulation. The precomputed values are saved to stat files.

  5. Select the Precomputed mode option and drag through the animation frames to see how the hair reacts.

Figure 38.2 shows the hair bending to one side as the female head moves.

image from book
Figure 38.2: Using precomputed hair can save you a bundle of time when rendering.




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net