Cal Poly CSC 457 Winter 1998 Particle Systems Design
Document
CSC 457 Winter 1998
Particle Systems Design Document
Project Title
-
Title: Bees
-
Author: Ian Chase
-
Date: March 2, 1998
Introduction
I will model how bees swarm out of their hive. The particle system should
model the bees initially swarming out of the hive and then flying around
the hive looking for someone to sting. This particle system may
eventually be incorporated in my "Man Runs From Bees" animation. This
animation contains a scene in which a man will run past the hive, bumping
it slightly causing all the bees to come out. Some will chase the man,
while other bees will remain, circling around the hive.
Particle Systems Model
-
Model Type Description
The model will consist of two main types of objects: The hive and the
bees. For this animation the hive will not change in any way. All of the
motion will be the bees that come out of the hive.
The bees will emerge from the bottom of the hive, at first they will fly
downward to distance themselves from the hive and then they will begin
their swarming motion around the hive. The constraint on the bee
particles will be that they cannot exceed a predetermined distance from
the hive. No external forces will act on the bees other than an internal
instinct to stay near the hive.
-
List of Properties that are Determined at Birth
-
Lifetime: These bees are immortal. They never die and they never
get tired. They live from the time they are born to the time the
program terminates.
-
Max. number of children: The bees will not spawn any children
(only the queen bee can do that and she remains in the hive)
-
Generation number: There will be no need to keep track of the
generation number.
-
Material and basic shape properties will be determined at birth.
+ Each bee will be two SoSphere with one SoCone
-
Speed scale value: this is a value that will be used in the
fuctions which determine the position of the bee
-
List of Properties that are Initialized at Birth and May Change
During Lifetime
-
Geometry
-
The geometry of each bee will remain constant during lifetime.
-
Material
-
The body of the bee will be black for the most part, except for
the sphere which makes the midsection of the bee. This sphere will initially
be red signifying that the bee is angry. As time progresses this color will
change to yellow.
-
Motion
-
Positional motion will vary in in every axis (x,y,z)
according to a fuction composed of a trig function and random
number generator. The function will also figure in the
the speed scale value of the bee, so each bee can move
at a different speed.
-
Rotational motion will only vary along the x and y axis.
The function for determining the bee's rotational values
will be similar to the function which determines the
positional values.
-
List and Description of Evolution Rules
-
Properties Determined at Birth
-
Each of the spheres and the cone of the bee will have a mean
radius of 1 with a variance of 0.5.
-
Each of the bees will have a speed scale value of 5 with a
vairance of .75.
-
Properties that May Change During Lifetime
-
The speed scale value of each bee will continuous decrease
over its lifetime at a rate of .001 for each second until the
speed scale value reaches a constant value of 1.
-
The x,y,z positions fo the bees will be determined by a
hermite function. At first all of the bees will descend
downward and then they will begin their swarming motion which
will consist of a randomly shaped eliptical path around the
hive.
Data Structure Definition
class Bee
{
public:
Bee(); // Create a bee with a 'random' initial velocity
void Update(); // Calculate the new values for the x,y,z
// position and adjust speed scale value
protected:
SoSphere* beeBody;
SoSphere* beeHead;
SoTransformation* HeadTrans;
SoCone* beeTail;
SoTransformation* TailTrans;
SoScale* beeSize;
float speed; // For calculating the next
// position with deceleration
}; // class Bee
class BeeNode
{
public:
BeeListNode();
void SetNextNode(BeeNode* next);
protected:
Bee beeData;
BeeNode* nextNode;
}; // class BeeNode
class BeeList
{
public:
BeeList();
Bool Add(BeeNode* node);
int GetCount();
protected:
int beeCount;
BeeNode* head, *tail;
}; // class BeeList
Simulation Program Description
-
Initialize system state
-
main simulation loop: for frame = 0, numFrames-1
-
simulation time = frame # / frame rate (i.e., rate in frames/sec.)
-
loop: for each particle
-
apply rules for updating motion
-
apply rules for updating position
-
apply rules for updating orientation (rotation on x and y)
Rendering Program Description
There will not be anything particularly special about how the particles
are rendered. Each particle is made from simple Inventor nodes and do
not require any special processing.