Adverti horiz upsell
How to create a simple crowd
How to create a simple crowd
adry, added 2005-09-27 14:44:16 UTC 122,766 views  Rating:
(5 ratings)
Page 3 of 4

The last section called "Output Function" allows to join with a weight all the functions seen before.
The default values are not definitive. In general a parameter with a high value has a big influence to generate the speed and the final direction.
"Seek" provides the ability to follow a target.
"Scale Value" instead controls the final velocity of each particle.





Now we insert obstacles in the scene, in this version (Crowd Maker 0.5) obstacle avoidance is 2D.
To speed up the script the obstacles are consider like nurbs circle, complex geometries can be placed inside a circle to approximate the shape.
Every nurbs circle must have a new attribute called "radius" with the value equal to its radius. Execute Create/NURBS Primitives/Circle to create the object, create the new attribute and setup it with a correct value.


click for larger version


We create an obstacle with a small table and four chairs, on the next figure you can see the geometry inside the circle. We set the "radius" attribute to 1.2.


click for larger version


To simplify the simulation we use only three obstacles.
Remenber to set up the attributes with correct values, otherwise you will see unexpected situations.
Select all the circle created and execute from the Shelf the function AddObstacle. The circle will be rename with the prefix "CMObstacle_", the script consider obstacle all the geometry with this name.


click for larger version


To see the new particles motion you must restart your Time Slider (to frame 0 or 1), the script loads the parameter of radius and position in the first frame.
The script is recalled in the Creation section of particles!
The previus image shows a complete scene with the particles, the locator and the obstacles.
We will execute the instancer function between particles and real geometry.