Collision Flag: Face vs. edge

Một phần của tài liệu BuMP and norMal MaPPIng (Trang 99 - 102)

The calculation is much faster than when Collision Flag is set to Face, but the nParticles stay within the tub. You may notice some bumping as the nParticles collide with the wireframe. Many times this may not be noticeable at all, which makes the Edge method useful for calculating collisions.

Figure 13.18 You can display the collision sur- face thickness using the controls in the nRigid body shape node.

The other settings in the Collisions section include the following:

Bounce This controls how high the nParticles bounce off the surface. Think of the Ping- Pong balls hitting the granite table and the sofa. The sofa would have a much lower Bounce setting than the granite table.

Friction A smooth surface has a much lower Friction setting than a rough one. nParticles will slide off a smooth surface more easily. If the sofa were made of suede, the friction would be higher than for the smooth granite table.

Stickiness This is pretty self-explanatory—if the granite table were covered in honey, the Ping-Pong balls would stick to it more than to the sofa, even if the friction is lower on the granite table. The behavior of the nParticles sticking to the surface may be different if Collision Flag is set to Face than if it is set to Edge or Vertex.

Figure 13.19 When Collision Flag is set to Ver- tex, the nParticles collide with each vertex of the col- lision surface, allowing some to fall through the bottom. When the flag is set to Edge, the nParticles col- lide with the edges, and the calculation speed improves.

You can use the display settings within the nParticle’s Attribute Editor to visualize the col- lision width of each nParticle; this can help you determine the best collision width setting for your nParticles.

1. Make sure that Collision Flag is set to Edge and that Bounce, Friction, and Stickiness are set to 0. Set Collision Thickness to 0.05.

2. Select the nParticle1 object, and open the Attribute Editor to the nParticleShape1 tab.

Expand the Collisions rollout panel for the nParticle1 object. These control how the nParticles collide with collision objects in the scene.

3. Click the Display Color swatch to open the Color Chooser, and pick a red color. Set Solver Display to Collision Thickness. Now each nParticle has a red envelope around it.

Changing the color of the display makes it easier to distinguish from the nRigid collision surface display.

4. Set Collide Width Scale to 0.25. The envelope becomes a dot inside each nParticle. The nParticles have not changed size, but if you play the animation, you’ll see that they fall through the space between the edges of the collision surface (see Figure 13.20).

5. Scroll down to the Liquid Simulation tab, and deselect Enable Liquid Simulation. This makes it easier to see how the nParticles behave when self-collision is on. The Liquid Simulation settings alter the behavior of nParticles; this is covered later in the chapter.

6. Turn on Self Collide, and set Solver Display to Self Collision Thickness.

7. Set Collide Width Scale to 1 and Self Collide Width Scale to 0.1. Turn on wireframe view (hot key = 4), and play the animation; watch it from a side view.

The nParticles have separate Collision Thickness settings for collision surfaces and self- collisions. Self Collide Width Scale is relative to Collide Width Scale. Increasing Collide Width Scale also increases Self Collide Width Scale (see Figure 13.21).

Figure 13.20 Reducing the Collide Width Scale value of the nParticles causes them to fall through the spaces between the edges of the nRigid object.

8. Scroll up to the Particle Size settings, and adjust the Radius; set it to 0.8. Both Collide Width Scale and Self Collide Width Scale are relative to the radius of the nParticles.

Increasing the radius can cause the nParticles to pop out of the top of the tub.

9. Set Radius to 0.4 and Collide Width Scale to 1, and turn off Self Collide. Turn Enable Liquid Simulation back on.

10. Save the scene as forge_v02.ma.

To see a version of the scene so far, open forge_v02.ma from the chapter13\scenes folder on the DVD.

The nParticles also have their own Bounce, Friction, and Stickiness settings. The Max Self Collide Iterations slider sets a limit on the number of calculated self-collisions per substep when Self Collide is on. This keeps the nParticles from locking up or the system from slowing down too much. If you have a lot of self-colliding nParticles in a simulation, lowering this value can increase performance.

The Collision Layer setting sets a priority for collision events. If two nDynamic objects using the same Nucleus solver are set to the same Collision Layer value, they will collide normally. If they have different layer settings, those with lower values will receive higher priority. In other words, they will be calculated first in a chain of collision events. Both nCloth and passive objects will collide with nParticles in the same or higher collision layers. So if the passive collision object has a Collision Layer setting of 10, an nParticle with a Collision Layer setting of 3 will pass right through it, but an nParticle with a Collision Layer value of 12 won’t.

Một phần của tài liệu BuMP and norMal MaPPIng (Trang 99 - 102)

Tải bản đầy đủ (PDF)

(105 trang)