Vector Field Space Warp

Create panel > Space Warps > Particles & Dynamics > Object Type rollout > Vector Field

A vector field is a special type of space warp that crowd members use to move around irregular objects such as a curved, concave surface. The Vector Field object, a box-shaped lattice, is placed and sized so that it surrounds the object to be avoided. The vectors are generated from the lattice intersections. These vectors are, by default, perpendicular to the surface of the object to which the field is applied; if necessary, you can smooth them out with a blending function. The crowd members move around the object by traveling perpendicular to the vectors.

You can use the vector field either as a Space Warp behavior or as the source object for an Avoid behavior, or both. When used together, delegates slow down when they approach a complex object, and then go around it. This guarantees that the delegate will not pass through the obstacle's surface.

The vector field includes settings for strength, falloff, and a push/pull effect, as well as options to display the lattice, the effective range, and the vectors.

The Vector Field space warp provides these rollouts:


To add a Vector Field space warp

Adding a Vector Field space warp object works the same as adding a Box geometry primitive.

  1. On the Object Type rollout, click Vector Field.

  2. Drag in a viewport to set the first initial dimensions.

  3. Click to create the space warp.

To use a Vector Field space warp with delegates

This procedure presents general guidelines for using the Vector Field space warp with delegates in a crowd simulation.

  1. Create an object to serve as an obstacle. This object must be an editable mesh or geometric primitive; it can have modifiers.

  2. Add a Vector Field space warp.

  3. Position and scale the space warp lattice so that it encloses the obstacle object.

    The lattice should be significantly larger than the object. The object should be located roughly at the lattice center.

  4. In the Lattice Parameters rollout, increase the Length Segs/Width Segs/Height Segs settings so that the lattice segments intersect the object at reasonable intervals.

    To determine appropriate Segs settings for your obstacle objects, first examine the object complexity. If the obstacle has a lot of detail, and you want that detail reflected in the vector field, then you need a relatively high lattice resolution.

  5. Click the Obstacle Parameters rollout > Compute Vectors group > None button, and then select the object that will act as an obstacle in the crowd simulation.

    This specifies the obstacle object. The range volume grid appears on the object's surface as an olive-colored wireframe.

  6. Increase the Obstacle Parameters rollout > Compute Vectors group > Range setting.

    As you increase this setting, you'll see the range volume grid expand. The range volume should enclose the space in which crowd members need to start turning in order to avoid the object.

  7. Turn off Display group > Show Lattice and Show Range so that the vector field will be more easily visible when generated.

  8. Turn on Display group > Show Vector Field.

  9. In the Compute Vectors group, click the Compute button. This generates the vector field.

    Tip: To make the vector lines more evident, increase the Display group > VectorScale setting.

    The vectors appear as blue lines surrounding the obstacle object. One vector is computed for each lattice intersection within the range volume grid. Each vector matches the normal of the object at the point on the object's surface closest to the lattice point.

    The vector force falls off with distance from the object, as shown by the progressively shorter vector lines toward the grid perimeter.

  10. Add Crowd and Delegate helper objects.

  11. Select the Crowd object and open the Modify panel.

  12. In the Setup rollout > Behaviors group, click New.

  13. In the Select Behavior Type dialog that appears, choose Space Warp Behavior, and then click OK.

  14. In the Space Warp Behavior rollout that appears, click the None button, and then select the Vector Field space warp.

    You might find it easiest to use Select By Name to select the space warp.

  15. In the Setup rollout, click the Behavior Assignments button, and use the Behavior Assignments and Teams dialog to assign your delegate or delegates to the space warp behavior.

  16. Add any other objects and/or behaviors appropriate to the simulation.

  17. Select the Crowd object, and then solve the simulation by clicking the Solve rollout > Solve button.

  18. Fine tune the behavior associated with the Vector Field space warp by adjusting the Lattice parameters and Obstacle parameters.

  19. Continue computing the vector field and then solving the simulation after each adjustment. In certain cases you might need to animate the vector field parameters to keep objects within the field.

To use a Vector Field space warp with a particle system

  1. Begin by following steps 1 to 9 in the previous procedure, To_use_a_Vector_Field_space_warp.

  2. Add a particle system in the vicinity of the vector field.

  3. Use the Bind to Space Warp tool to bind the particle system to the Vector Field space warp.

    The particles should use the vectors to move around the obstacle object. If they don't, you may have to slow them down so that the vector field has a chance to calculate their positions.