Force one surface to fit around several other surfaces.

March 31st, 2008 | by Todd Palamar |

Shrink Wrap

quicktime_1

Elements:

  1. NURBS or Polygon target objects
  2. Polygon source mesh

Overview: In this example, we take a modeled polygon arm or “skin” and have it conform to underlying muscles. Although the purpose is for better skin simulation, shrink wrapping geometry can be used for a variety of techniques and provides cool animation effects.

Getting Started…

1. Define which objects you want your geometry to shrink wrap around. These are the target objects. Select them all and choose Soft/Rigid Bodies > Create Passive Rigid Body. You can select them all at once, or one a time, it doesn’t matter. (Figure 1)

figure1

2. Next, position the geometry you want to shrink wrap around the newly formed passive rigid bodies. This is your source mesh. Make sure all of its vertices are outside the mesh of your target objects. Nothing can be penetrating. (Figure 2)

figure2

3. Make your source object a soft body. This is the important part. Choose Soft/Rigid Bodies > Create Soft Body and open the tool options box. Set Create Options to Make Soft. By doing this all of the other options are grayed out. This creates a soft body object without a goal. Basically, it creates a particle for each vertex, making each one dynamic. There are no forces in the scene however, which means, the particles are not going anywhere. (Figure 3)

figure3

4. In order to get the particles to move you need to add springs. Select the particles. Choose Soft/Rigid Bodies > Create Springs tool options box. Modify the spring attributes by un-checking all of the Use Per Spring boxes. Set the Damping to zero and the strength to 1. Under Spring Methods, you want to use Min/Max. Set these values high enough to have springs slightly overlapping each other. In general, the maximum value is set to about an eighth of the models length. It does not have to be exact. You want the springs to look something like the configuration shown in the STEP 4 image to the right. In this example a minimum value of zero and a maximum value of 3 was used. (Figure 4)

figure4

5. Press play on the time slider. The springs shrink into themselves because we are using a Rest Length smaller than their actual size. By turning off Use Rest Length Per Spring all the springs are forced to use the value entered for Rest Length which is zero. The value can be set to one and the effect still occurs. Try setting it to the value you entered for the maximum distance when first establishing the springs. You can get some interesting effects and quickly see how powerful springs can be.

6. Next, lets make the particles collide with the passive rigid bodies. Return the simulation back to frame one. Select the particles.

***Note***
Hold shift down and select a single rigid body. Choose Particles > Make Collide. Hold shift down again and select the same rigid body to deselect it. Still holding shift, select another rigid body. Choose Particles > Make Collide. Repeat this process until all of your target objects are set to collide. You must assign each rigid body individually. Do not worry about any of the collision attributes just yet.

***Note***
Press g on the keyboard to repeat your last command, Make Collide.
It is a good idea to assign the elements to separate layers. It makes selection a lot easier. Assign the springs to its own layer, the particles to a layer, the source to a layer, and finally all the targets into one layer. This way you can select the particles and turn off the visibility for everything else, except the targets for easier selection. You can also turn off Dynamics from the Show menu in the perspective window.

7. Once they are assigned modify the geoconnector to alter the collision attributes.***Note*** Change the Resilience to zero and the Friction to 1. The Tessellation Factor only comes into play if your target objects are NURBS. You can use this attribute to increase the complexity of the surface for better collision detection. To make a guess, think how many triangles the NURBS surfaces would have to have to look as smooth as NURBS.

***Note***
For this example, 2000 was used for all of the rigid bodies.

For greater accuracy you can turn on Display Render Tessellation in the attribute editor of the NURBS object. Doing this turns on the Triangle Count of the NURBS object. By adjusting the Simple Tessellation Options, directly below the Triangle Count value, you can increase its render tessellation. For our purpose, this only gives us visual feedback of what the particles will actually collide against. When you are satisfied with the surface smoothness use the Triangle Count value for your Tessellation Factor. You can then turn off Display Render Tessellation.

It is necessary to modify collision attributes after assigning them because, the Tessellation Factor is not available in the Make Collide tool options. A quick way to access this node is to type geo* in the quick select box at the end of the status menu bar. By adding the wildcard * (asterisk) you select everything with the geo prefix.

8. Play through the animation again. The springs once again shrink into themselves. This time however, the particles collide against the passive rigid bodies. With a Friction of 1, from the geoconnector node the stick to the surfaces they hit. (Figure 5)

figure5

9. Modifications:

  • Spring Stiffness: By modifying the Stiffness of the springs you can control how fast the shrink wrap occurs. Dropping it down to a decimal value is usually where it needs to be for smooth animation. The Quicktime example was done at .005. Taking the Stiffness to a high value or adding dampening usually ends with the springs bouncing to infinity, cool to watch, but not very practical.
  • Spring Quantity: Altering how many springs attached to each particle has a big affect on how accurate your source geometry conforms around your targets. The fewer springs, the less accurate. You can experiment by altering the Min/Max settings or changing the Creation Method to Wireframe or All. For even finer control modify the Wire Walk Length.
  • Particle Conserve: Altering the Conserve on the ParticleShapeNode adds some stability to your simulation by removing the physical properties of the particles themselves. It can also slow the shrink wrap effect down. The Quicktime example used a particle of zero.

You must be logged in to post a comment.