FlockModifier

FlockModifier

Get the sourcecode:
github.com/fwilleke80/FlockModifier

Download release:
github.com/fwilleke80/FlockModifier/releases

Licensed under:
GPL 3.0

FlockModifier example

FlockModifier is a modifier object for the good old standard particle system im CINEMA 4D. It allows to easily apply the behavior of flocks, swarms or schools to the particles.

The modifier uses a distributed behavioral model, as described by Craig Reynolds on his 1987 SIGGRAPH paper "Flocks, Herds, and Schools: A Distributed Behavioral Model".

Several of the classic "Reynolds Rules" are implemented. Each particle will...

See it in action here:
http://vimeo.com/51060304

Installation

Just unzip the archive and place the folder "FlockModifier" inside the folder "CINEMA 4D Rxx/plugins".

When you start CINEMA 4D the next time, the Flock Modifier will be available from the Plugins menu.

Help

Attributes explained...

Object

Basic parameters for the particle modifier.

Weight

The overall weight of the Flock Modifier. This effectively controls the intensity of the modifier's effect.

Flocking

The parameters in this tab control the typical behavior of the flock.

Flocking

Neighbor Range

This is the range of sight in which a boid will "see" a neighbor and consider it in its calculations.

Center Flock

A boid will try to stay in the center of the flock. This emulates the behavior of fish and birds, looking for safety in the crowd.

The Neighbor Range parameter has direct influence on the calculation of the flock center: A boid will look at all its neighbors within the range of sight and consider the average of their positions as target position.

Weight

Controls how much a boid wants to follow this rule.

Neighbor Minimum Distance

To avoid colloding with its flockmates, a boid will try to keep a minimum distance to its neighbors.

A boid will look at all its neighbors within the range of sight and measure the distance to each of them. If a neighbor is nearer than the minimum distance allows, the boid will attempt to move away from it.

Please note that this is a "soft rule": It only determins what a boid wants to do, but there is no guarantee that the boid doesn't have to do something else, after all.

Weight

Controls how much a boid wants to follow this rule.

Distance

Boids will try to stay at least this far away from each other.

Match Flock Velocity

A boid will try to adapt to the average travel direction and speed of the neighbors within the range of sight. That is another behavior that makes a boid "blend with the crowd".

Weight

Controls how much a boid wants to follow this rule.

Level Flight

A boid will avoid rising or sinking very steep and attempt to fly level.

Weight

Controls how much a boid wants to follow this rule.

Turbulence

To give a flock some randomness and make it look more cool, natural, and realistic, a turbulence field can be applied to it. This will make a boid slighty turn into a random direction.

Weight

Controls how much a boid wants to follow this rule.

Frequency

Defines how rapidly the pattern of the variation changes.

Scale

Defines how small or large the pattern of the variation is.

Control

These parameters allow you to keep the flock under control and to have some more direct influence.

Speed Limits

Weight

If "Mode" is set to "Soft", this controls how much a boid wants to follow this rule.

Mode

Min

The boid will try not to move slower than this (Units/second).

Max

The boid will try not to move faster than this (Units/second).

Target

A boid will chase any number of given target positions, which are defined by linked Target Objects. Chasing a target is not actually a very realistic behavior, since fish and birds do not always do that. But it's a good way to control the position and direction of the flock.

Unlike the previous rules, this one does not take the range of sight into account.

Weight

Controls how much a boid wants to follow this rule.

Objects

Link the objects here, that the boids feel attracted to.

Flock Target Object

These objects have to be used in the Target.Objects list of the Flock Modifier.

You can find the Target Object in the plugins menu.

Enabled

Disable this and the boids will ignore this target.

Weight

Use this weight to control effectiveness of this particular target.

Radius

Control the radius of this target. Boids that are inside the radius will chase it.

Infinite

Enable this and the boids will be attracted to this target, regardless of their distance to it.

Repeller

A boid will flee from a repeller when inside its repelling radius. Any number of repellers can be defined by linking Repeller Objects.

Weight

Controls how much a boid wants to follow this rule.

Objects

Link the objects here that the boid will try to espace from.

Flock Repeller Object

These objects have to be used in the Repeller.Objects list of the Flock Modifier.

You can find the Repeller Object in the plugins menu.

Enabled

Disable this and the boids will ignore this repeller.

Weight

Use this weight to control effectiveness of this particular repeller.

Radius

Control the radius of this repeller. Boids that are inside the radius will try to escape.

Avoid Geometry

A boid will try to avoid colliding or penetrating a geometry. However, it might happen.

A ray will be cast along the travel direction of each boid. If the ray hits the geometry within the defined distance, the boid will turn and go into the direction of the surface normal. The closer it gets to the surface, the more quickly it will turn away from it.

Weight

If "Mode" is set to "Soft", this controls how much a boid wants to follow this rule.

Distance

This defines the distance from the surface in which a boid will "realize" the risk of collision and start acting to avoid it from happening.

Mode

Geometry

Link a polygon object here. Only polygon objects are supported.