Cube Explosion

This cube explosion is achieved by implementing a simple vector struct that requires a x, y, z coordinates and a variable for direction. Each particle in the cube explosion has randomized x, y, z constants which determine the direction in which the particle will travel in a straight line.

i.e.

typedef struct Vector {

float x;
float y;
float z;
int direction;

} Vector;

typedef struct Particle {

Vector vPosition; // Position in space

} Particle;

10,000 particles were used for the explosion and all particles originate at the center of the cube. Particles move at a constant velocity and gradually fade into the darkness over time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s