last modification of this documentation: October 29th 2010
this page is best viewed with Mozilla Firefox or IE8
On the emFlock web page you can:
This documentation has the following chapters:
If you feel that something is not well explained (or not explained at all) then please write me a short e-mail.
I will then update the documentation and/or make a demo scene as quickly as possible.
On my Vimeo page are many video tutorials in which I show and explain different aspects and techniques concerning emFlock and its usage.
This plug-in comes as a so called "Add-On", here's how to install it:




The main node of this plugin and its core is a compiled C++ node.
It calculates the flocking behavior for the particles based on their current position and velocity and then outputs a new velocity.
First a brief description of the parameters as seen in the picture of the node's PPG on the right:
The following picture illustrates how the view cone, the view cone falloff and the view distance are to be understood.
The view cone and view distance are very similar to a spot light, anything contained in the cone is visible for the particle.
The Input Ports
Many of the input ports have a "per object or point of point cloud" context, so that you can create complex setups by giving each particle a different behavior.
The Output Ports
In most cases you will probably only use the port "Set Flocking Velocities". It will simply set the particle velocity to the new flocking velocity that have been calculated.
But aside from the velocity the emFlock node also calculates the neighbor particles' positions, distances, etc. This data can be used to perform additional tasks, like for example:
The output ports and their data in detail:

This node let's you control the speed of particles.
You can define a so-called "Cruising Speed". This is the speed the particle would like to have (but not necessarily have!). Depending on the value of the parameter "Strength" the particle will slowly try to reach its cruising speed.
A typical example would be a fish that accelerates in order to avoid another fish. Once the fish is avoided it will slowly return to its normal cruising speed.
The "Speed Clamp Interval" defines a velocity range for the particles, so that the speed will never drop below the minimum nor exceed the maximum speed interval.
The "Simple Drag Force" is exactly what its name suggests.

A "all in one" orientation alignment node.
Use this node to align the orientation of particles. You can choose one of the six particle's local axes that shall be used. Furthermore you can specify either the velocity vector or a custom point in space to that the orientation is to be aligned.
The additional parameters "Rotational Velocity", "Up Vector", "Reduce Flipping", etc. let you create a soft orientation alignement that won't have any hard flipping.
So basically this node aligns the orientation slowly so that the animation always looks nice.

This node affects the alignement of the velocity vector.
For a given plane (defined by its normal vector) the velocity of the particles will slowly be modified in order to be parallel to the plane. The parameter "Strength" controls how fast the velocity is aligned.
This node is can be very handy because even though it modifies the velocity it still gives other effects enough room to operate.
A typical example:
You have a flock of fish that, most of the time, swim parallel to the ground. Sometimes a fish needs to avoid another fish so it might swim up to avoid it. Once that is done this node will make the fish slowly go back to its "normal" swimming direction.

This node modifies the direction (not the speed) of particles so that they fly towards a goal defined by a position as well as a radius, similar to a Disc Area Light.
The parameters:
Thanks to its radius the goal has an area so that particles do not fly towards the center of the goal but rather to the closest point of the area. The picture below shows the trajectories of particles that move towards a point goal (top) and an area goal (bottom).

This little node lets you define what I call a "playfield" for the particles. It is simply a bounding volume described by two points. Whenever particles leave the playfield they will try to go back in, depending on the "mode".
Mode "Asteroids"
Just as in the classic video game "Asteroids" everything that leaves the playfield on one side simply re-enters it on the opposite side. If for example a particles leaves the playfield on the right side then it will re-enter it on the left side.
Mode "Home, Sweet Home"
This mode is less rigid than the "Asteroids" mode. When a particle leaves the playfield then it will attempt to fly back into it.
Most of the demo scenes use this node to prevent the flocks from flying into Nirvana.
everything is new because this is version 1.0.
"sorry, but there currently is no license available
this can occur even when there are enough licenses available. The most probable cause is that you do not have write permission for the current project.
"sorry, but there currently is no license available
if you are working with the full version of emFlock and your current project is "XSI_SAMPLES" then emFlock might not evaluate properly and display the above message.