Page 1019 - Kitab3DsMax
P. 1019

Chapter 39: Animating with CAT and Creating Crowds
                                             solve for a single frame at a time. By default, the solution saves keyframes for every frame, but you can
                                             increase the Positions and Rotations values to compute the simulation faster.
                                             Tutorial: Rabbits in the forest
                                             This example uses the delegate primitives linked to rabbit meshes to navigate through a forest. Moving sev-
                                             eral objects through an array of objects can be time consuming when done by hand, but the Crowd system
                                             makes it easy.
                                             To move a group of rabbit delegates through an array of trees, follow these steps:
                                                 1. Open the Bunny in the forest.max file from the Chap 39 directory on the DVD. This file includes
                                                    several pine trees and a bunch of bunnies.
                                                 2. Select the Create ➪ Helpers ➪ Crowd menu command, and drag in the viewport to create a Crowd
                                                    object. Make the Crowd object big enough to be easily selected.
                                                 3. Select the Create ➪ Helpers ➪ Delegate menu command, and drag in the Left viewport to create a
                                                    Delegate object positioned outside the trees. Rotate the bunny to set its orientation, and then link
                                                    the bunny to the delegate object. Then Shift+drag the delegate to create six total delegate bunnies
                                                    positioned about the cubes.
                                                 4. Select the crowd object, click the New button in the Setup rollout of the Modify panel, select the
                                                    Avoid behavior, and name it Avoid trees. In the Avoid Behavior rollout, click the Multiple
                                                    Selection button. In the Select dialog box that appears, choose all tree objects and click the Select
                                                    button. Enable the Display Hard Radius button, and then decrease the Hard Radius value to 0.2
                                                    so that bunnies can travel through the trees.
                                                 5. Click the New button again. This time, select the Seek behavior and name it Seek hole. In the
                                                    Seek Behavior rollout, click the None button and choose the red box object that represents the
                                                    hole.
                                                 6. In the Setup rollout, click the Behavior Assignment button to open the Behavior Assignment and
                                                    Teams dialog box. Click the New Team button, select all delegate objects, and click OK. Then
                                                    select the Team0 team and the Avoid cubes behavior, and click the center New Assignment but-
                                                    ton (the long, thin button with the right-pointing arrows). Select the Team0 team again with the
                                                    Seek goal behavior, and click the New Assignment button again. Both assignments are listed in
                                                    the center pane; click OK.
                                                 7. Set the Solve time equal to the animation length of 300 frames. In the Solve rollout, click the
                                                    Solve button.
                                                    The crowd system solves the movement of all delegates as they move toward the goal.
                                                 8. Click the Play Animation button to see the resulting solution.
                                             Figure 39.23 shows the position of the delegates after the simulation has ended. Notice the random position
                                             of the various delegates.















                                                                                                                       971
   1014   1015   1016   1017   1018   1019   1020   1021   1022   1023   1024