INSIDE 3DS MAX® 7 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

INSIDE 3DS MAX® 7 [Electronic resources] - نسخه متنی

Adobe Creative Team

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











  • Breaking the Ice


    We'll begin by defining some basic principles of reactor behavior. The first concerns the difference between a single object and many objects. Generally, a single cohesive object breaks apart differently than a group of separate objects that happen to be close to one another, just as a concrete wall breaks apart much differently than loose bricks stacked in the shape of a wall. In reactor, a single cohesive object destined to be broken apart is represented by a helper object called a fracture (Figure 16.3). This tool will be useful to you any time you need to shatter something, whether it's an eggshell, an ice cube, or an asteroid.

    Figure 16.3. The Create Fracture button on the reactor toolbar creates a reactor fracture object.

    A fracture object is basically a container, a nonrenderable object that holds a number of renderable objects. (Let's refer to the renderable objects as fragments from now on, reserving the term fracture for the nonrenderable helper object.) By grouping the fragments into a fracture, you tell reactor to apply forces to the fragments to make them behave initially as one cohesive unit. Later, if the cohesive unit is broken by some external force, the fragments may began to behave like separate objects.

    In this chapter we'll create an iceberg that gets shattered by a jumping dolphin. The fracture object contains four chunks of ice that together form the iceberg. By putting the chunks in a fracture, we tell reactor to create the illusion that the iceberg is a single object breaking into pieces. In reality, it is already in pieces, but they fit together seamlessly and don't break apart until they are struck by the dolphin/sprite.

    Our first job is basically to create a 3D jigsaw puzzle, something that looks like a single object but is actually made up of multiple sub-objects. There are many ways of going about this. Two related issues to consider in selecting the best approach are interpenetrations and convexity/concavity.

    It is permissible in reactor for fragments to interpenetrate one another. However, for our iceberg, we want to avoid or at least minimize interpenetrations among fragments, for two reasons: First, we don't want chunks of ice visibly passing through one another, since real chunks of ice don't do that. Second, interpenetrating fragments tend to produce highly "explosive" fragmentation, as reactor by default tries to push interpenetrating objects apart very quickly, so that periods of interpenetration will be too brief to be noticeable. In the first example scene shown here (Figure 16.4), the lower two balls are fragments in a fracture object, with significant interpenetration. When the top ball falls on them, they are knocked far apart quickly (Figure 16.5). In the second example (Figure 16.6), the lower two balls are fragments with no interpenetration. When the top ball falls on them, they are not knocked apart nearly as fast or as far (Figure 16.7).

    Figure 16.4. Interpenetrating fragments (bottom two spheres).

    [View full size image]

    Figure 16.5. Interpenetrating fragments resulting in explosive fragmentation.

    [View full size image]

    Figure 16.6. Non-interpenetrating fragments (bottom two spheres).

    [View full size image]

    Figure 16.7. Non-interpenetrating fragments resulting in nonexplosive fragmentation.

    [View full size image]

    Highly explosive fragmentation may be perfect for some situations, such as in videogame space combat. In this case, though, we don't want our ice chunks to go flying off at high velocity in all directions when struck by the dolphin, so we need to moderate the explosiveness with which the fragments separate. The most elementary precaution for moderating explosiveness is to minimize interpenetrations.

    Another issue we need to take into account is the convexity or concavity of our fragments. In reactor, an object is convex if a line connecting any two points on the surface of the object will never go outside the object. Any object that is not convex is concave. For instance, in our next example (Figure 16.8), the egg is convex, the egg cup is concave. (The 3ds max file for this figure, egg&eggcup.max, is included on the DVD.)

    Figure 16.8. The egg is convex, the egg cup is concave.

    Note

    To determine whether an object is convex or concave, select the object, go to Utilities > reactor > Utils > Selection, and click the Test Convexity button. You will get a message telling you whether the object is convex or concave.

    Simulating concave objects puts more stress on the processor than simulating convex ones. In many instances, the concavity really isn't important to the simulation, so by default reactor treats concave objects as if they were convex. However, if a fragment is really concave, treating it as convex can increase the explosiveness of fragmentation if another object happens to occupy the empty space created by the concavity.

    For example, in Figure 16.9, the concave object on the left and the convex object on the right will not actually interpenetrate when brought together to form a sphere. However, if reactor doesn't know that the object on the left is concave, it will treat it as something close to a sphere, and it will consider that the two objects do interpenetrate. In such cases, reactor sees more interpenetration than really exists, so it applies a more explosive separation force than it would if it knew the truth. You can greatly reduce the explosiveness of the fragmentation by telling reactor that the fragment is in fact concave. The cost is a greater load on the processor, which can mean longer waits while reactor analyzes or creates your virtual world. (The added time, however, might not be noticeable in the case of a simple, low-poly fragment.)

    Figure 16.9. When the object on the left is defined as concave, reactor sees the two objects as non-interpenetrating.

    Let's briefly explore the concavity/convexity issue in an exercise.

    Convex and Concave Fragments


    If you wish to examine the finished 3ds max scene implementing this exercise, open concave_convex.max on the DVD. The rendered movies are concave_convex1.avi (explosive version) and concave_convex2.avi (nonexplosive version).


    1.

    In the Top viewport, create a sphere with a radius of 50 and position it at the origin (0,0,0).

    2.

    In the Modify panel, apply a Squeeze modifier to Sphere01 and set the Axial Bulge Amount to .9. This will be our concave fragment. Note that it has concavities both above and below (Figure 16.10).

    Figure 16.10. A sphere with a Squeeze modifier, to be used as a concave fragment.

    [View full size image]

    3.

    In the Top viewport, create a sphere (Sphere02) with a radius of 25 and position it at (0,0,15). This will be an interpenetrating fragment (Figure 16.11).

    Figure 16.11. Interpenetrating fragments.

    [View full size image]

    4.

    Select Sphere01 and Sphere02 and click the Create Fracture button on the reactor toolbar at the left-hand side of the screen. This creates a fracture object containing the two spheres.

    5.

    Still leaving the two spheres selected, click the Open Property Editor button (Figure 16.12) on the reactor toolbar, and in the Rigid Body Properties dialog, set Mass to 100 (Figure 16.13). This sets the mass property for both fragments. The number was selected arbitrarily; it represents 100 kg. Objects with zero mass do not move in reactor, so this is an important step.

    Figure 16.12. The Open Property Editor button on the reactor toolbar.

    Figure 16.13. The Rigid Body Properties dialog, with Mass set to 100.

    6.

    In the Top viewport, create a box with a length and width of 150 and a height of 10. Position it at (0,0,75). The box is shown in the Perspective viewport in Figure 16.14. Note that we are not giving the box any mass, so it will not move.

    Figure 16.14. A box with a length and width of 150 and a height of 10.

    [View full size image]

    7.

    Select everything in the scene and click the Create Rigid Body Collection button on the reactor toolbar. This creates a rigid body collection and adds both spheres and the box to it (Figure 16.15).

    Figure 16.15. Creating a rigid body collection.

    [View full size image]

    8.

    Click the Analyze World button on the reactor toolbar. You should get a message, "World Analysis gave no warnings".

    Note

    This step is not necessary if you've done everything correctly. However, it will warn you if you haven't.

    9.

    Click Preview Animation on the reactor toolbar. When the reactor Real-Time Preview window (Figure 16.16) comes up, press P on the keyboard. Real-Time Preview gives us a preview of the animation without actually creating keyframes. The concave fragment bounces high in the air. It's an explosive fragmentation: We haven't yet told reactor that the Sphere01 fragment is concave, so it sees a deep interpenetration between the two fragments. Exit the reactor Real-Time Preview window by pressing Esc.

    Figure 16.16. The reactor Real-Time Preview window.

    [View full size image]

    10.

    Select Sphere01 (the concave fragment) and click the Open Property Editor button on the reactor toolbar. In the Simulation Geometry section of the Rigid Body Properties dialog, the Mesh Convex Hull radio button is selected. Select the Concave Mesh radio button instead.

    11.

    Again, click the Preview Animation button and press P. The concave fragment hardly bounces at all this time. It's a nonexplosive fragmentation, because reactor now treats Sphere01 as concave. The scene and the objects are simple enough that the increased processing time is probably not noticeable.


    The above exercise demonstrates that interpenetrations among fragments tend to cause explosive fragmentation, with a possible exception for concave fragments that reactor knows are concave. There are other configuration options that can also help moderate explosiveness. We'll look at some of them a little later. They're generally more appropriate for fine-tuning than for trying to undo the effects of massive interpenetrations.

    By the way, if you want to find out whether there are interpenetrations among your fragments, there is a simple way to get that information. As long as the fragments are part of an enabled fracture object, 3ds max will not issue any warning about interpenetrations among the fragments, because interpenetrations are considered perfectly legal for fragments. However, if we disable the fracture, max will see the fragments only as members of a rigid body collection. Interpenetrations are generally considered a bad practice for rigid bodies, so we'll get warnings when there are interpenetrations. To disable the fracture, select it, go to the Modify panel, scroll down to the very bottom of the Properties rollout, and check the Disabled check box; the box should be unchecked initially for an enabled fracture, as shown in Figure 16.17. Now click the Analyze World button on the reactor toolbar. If there are interpenetrations, you'll get a message like "Bodies Sphere01 and Sphere02 are interpenetrating." You'll get the same message if you click Preview Animation.

    Figure 16.17. The Properties rollout for a fracture, with the Disabled check box unchecked.

    Tip

    If you don't get the "Bodies are interpenetrating" message, check the masses of the bodies in the Rigid Body Properties dialog by clicking the Open Property Editor button on the reactor toolbar. If both bodies have zero mass, reactor will not warn about interpenetrations.

    Creating Fragments


    When creating fragments, it's ideal to use convex meshes, or at least meshes that can be treated as convex without causing explosive fragmentation. Using such meshes minimizes processing time without causing explosive fragmentation. That's the ideal we'll be aiming for.

    Probably the easiest approach to creating fragments is to align separate objects so that they form a visually unified whole. This is easiest when all the fragments are rectangular, such as a square table with rectangular legs or a building constructed of rectangular boards.

    Another simple example is a brick wall. Each brick is a member of the fracture, and they are all arranged to form the wall. The bricks are all convex, and you can easily arrange them to look like a solid wall but avoid interpenetrations. (Or you could deliberately cause them to interpenetrate to increase the strength of the explosion.) In the tutorials that are included with 3ds max 7, there is an example using bricks. (See Help > Tutorials > Using reactor and Flex for Simulation > Simulating Fractures with reactor.)

    The bricks approach is not optimal for our iceberg, however. Unlike brick walls, icebergs are highly irregular in shape. There is simply no straightforward way to create separate objects that will fit together naturally, without interpenetrations, to form a nice icebergy-looking iceberg.

    Another approach we won't pursue, though it works for some situations, is based on Booleans. Using this approach, you would create a "cutter" object, clone both cutter and iceberg, and then create a Boolean intersection of one iceberg and one cutter and a Boolean A-B of the other iceberg and cutter. You would end up with two objects: the Boolean A-B (which would essentially be the iceberg with a cutter-shaped hole in it) and the Boolean intersection (which would precisely fill that hole). You could continue cutting up either or both of these pieces by creating a new cutter object and repeating the process.

    The Boolean-based technique gives maximum flexibility in defining the shapes of the fragments (which are basically determined by the shapes of the cutter objects). It also requires many keystrokes and/or mouse clicks per fragment. More significantly, if the overlapping part of your cutter is anything but perfectly flat, you'll end up creating one concave fragment and one convex fragment interpenetrating itjust what we're trying to avoid. (If the overlapping part of your cutter is perfectly flat, see the discussion of slicing below. It's a much easier way of doing the same thing.)

    Another viable approach that we won't use here starts by creating a Connect compound object, which becomes the "quarry" from which you mine your fragments. In the simplest case, you start with two objects with holes in them, and the Connect object builds a "bridge" between the holes. More complex Connect objects can be created by bridging more than two hole-y objects. To avoid interpenetrations, make sure that the edges of each hole are coplanar (all lying in one plane). That way, at the point where they might be in danger of interpenetrating, both fragments will be perfectly flat, and there will be no interpenetrations. One way to accomplish this is to delete just one polygon per hole. Another way is to use a Slice Plane to create new edges.

    The technique we will pursue in detail in this chapter is based on cutting up the iceberg object with a Slice Plane.

    The Slice Approach


    For this chapter, we create fragments by using a Slice Plane to cut our iceberg into elements. Then we clone those elements to create separate objects. A limitation of this approach is that the surfaces along which the "quarry" object breaks will always be perfectly planar. They can't be curved or irregular. This very limitation happens to be a strength in the case of our iceberg, though, because it eliminates interpenetrations even when reactor treats the fragments as simple convex bodies. As we've seen, non-interpenetrating convex bodies automatically moderate explosiveness without incurring any processing overhead.

    The workflow for this approach is quite efficient. For example, to create the iceberg in this chapter, we create one quarry object and slice it twice, creating four chunks. Four fragments with two slices: That's efficiency! If you need more than four chunks, take any chunk and follow the same procedure to divide it into four.

    The basic approach can be summarized in three steps:


    1.

    Create a pyramid-shaped editable poly, with significant noise distortion.

    2.

    Use Slice Planes to slice it vertically and horizontally. This creates four elements.

    3.

    Detach those elements to clones.


    If you are planning to create the main project described in this chapter, open Dolphin&Rider_start.max from the DVD. This file contains the starting scene that you will use in this project.


    1.

    In the Top viewport, create a pyramid with four segments in each dimension (width, depth, height). Set Width and Depth to 150 and Height to 75. Position it at (120,11,15).

    2.

    Apply a Noise modifier. Check the Fractal box, and set Roughness to .5. Set Strength to 50 in each axis (X, Y, and Z) (Figure 16.18).

    Figure 16.18. The Noise modifier.

    [View full size image]

    3.

    Right-click in the selected pyramid. From the Quad menu, choose Convert To > Convert to Editable Poly (Figure 16.19). You have completed step 1 of the basic workflow described above.

    Figure 16.19. The Convert to Editable Poly option.

    4.

    In the Modify panel, at the Element sub-object level, select the pyramid. It should turn red. Click Slice Plane in the Edit Geometry rollout. The Slice Plane button turns yellow, and a yellow rectangle representing the Slice Plane appears in the viewport. Check the Split box to the right of the Slice Plane button (Figure 16.20). The Split option creates double sets of vertices at the points where the edges are divided, resulting in a perfect snug fit between the fragments.

    Figure 16.20. The Slice Plane option in the Edit Geometry rollout, with Split selected.

    [View full size image]

    5.

    Position the Slice Plane horizontally about halfway through the iceberg, and click the Slice button (just below the Slice Plane button). Then rotate the Slice Plane 90 degrees to position it vertically (Figure 16.21) and, making sure that the whole pyramid is still selected, click the Slice button again.

    Figure 16.21. The Slice Plane.

    [View full size image]

    6.

    Click the Slice Plane button to turn it off. You have completed step 2 of the basic workflow described above. You should have four elements now. To confirm, first click off the pyramid to deselect any elements. Then, staying at the Element sub-object level, select each of the elements in turn.

    7.

    Select the lower right element and click Detach in the Edit Geometry rollout. In the Detach dialog, select Detach As Clone and click OK (Figure 16.22). Do this for the lower left, upper right, and upper left elements in turn. (The order is not really important, but when you do it in this order, your fragment names will match those in this chapter.) This completes step 3 of the basic workflow described above.

    Figure 16.22. The Detach dialog.

    [View full size image]

    8.

    Exit the sub-object level. You can delete or hide Pyramid01, the original pyramid that you created. You don't need it any more.

    9.

    Select Object01, Object02, Object03, and Object04, the four fragments you just created, and apply a Cap Holes modifier to them.

    10.

    Select each of the four objects in turn and assign a unique color to it. This will make it much easier to follow the trajectory of each fragment when previewing animation.

    You should now have a file resembling Dolphin&Rider_02.max in the files on the DVD.

    11.

    Save your work as my_Dolphin&Rider_02.max.


    OK, we've created our fragments! Now let's test them and make sure they start in a stable position.


    • / 193