Cal Poly CSC 457 Winter 1998 Particle Systems Design Document

CSC 457 Winter 1998

Particle Systems Design Document

Computer Science Dept., Cal Poly State University

Project Title

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

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

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.