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:
Create Method Rollout
Lattice Parameters Rollout
Obstacle Parameters Rollout
To add a Vector Field space warp
Adding a Vector Field space warp object works the same as adding a Box geometry primitive.
On the Object Type rollout, click Vector Field.
Drag in a viewport to set the first initial dimensions.
If using the Cube creation method, this sets all three dimensions simultaneously.
If using the Box creation method, release the mouse button, and then move the mouse vertically to set the height.
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.
Create an object to serve as an obstacle. This object must be an editable mesh or geometric primitive; it can have modifiers.
Add a Vector Field space warp.
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.
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.
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.
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.
Turn off Display group > Show Lattice and Show Range so that the vector field will be more easily visible when generated.
Turn on Display group > Show Vector Field.
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.
Add Crowd and Delegate helper objects.
Select the Crowd object and open the Modify panel.
In the Setup rollout > Behaviors group, click New.
In the Select Behavior Type dialog that appears, choose Space Warp Behavior, and then click OK.
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.
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.
Add any other objects and/or behaviors appropriate to the simulation.
Select the Crowd object, and then solve the simulation by clicking the Solve rollout > Solve button.
Fine tune the behavior associated with the Vector Field space warp by adjusting the Lattice parameters and Obstacle parameters.
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
Begin by following steps 1 to 9 in the previous procedure, To_use_a_Vector_Field_space_warp.
Add a particle system in the vicinity of the vector field.
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.