Model Animation with Particle Effects

For my final project, I decided to use particles to display a model. I imported the model into my program, then with a stream of particles (which the user can manipulate with keyboard keys) display the model. The program starts off with just the axis and a burst of particles from the center of the screen. Then the particles start to hit the model and bit by bit the model begins to appear. As the user moves the particle direction, more of the model is shown until it is completely displayed.

Pictures

Burst of particles

Stream of particles

Project Details

For importing my model, I have a structure for the x, y and z coordinates along with vectors for the normals, coordinates, and polygons. To read in the coordinate and polygon files, I use fstream. I read in the file, then push back the coordinates/polygons onto a temporary coordinate/polygon vector. I also have other functions to calculate the normals, along with collision.

To draw the model, I use a temporary float array to store face normals. Then I loop through all of the coordinates and polygons and draw them on screen. For the particle effects, I give each particle a life, a speed, and a fading value so they can disappear. I have a struct that contains this plus more information for the particles. Then I give the particles a color. When I draw them, I give each individual particle a separate life, fade value, speed, and color. Each particle also has a different zoom effect so they can appear closer or further away.

What the user can do is change the direction of the particle stream. When the program first starts, there is an explosion of particles, then the particle stream begins. After that, the user can press any arrow key to move the particle stream in a different direction.

User Guide

  • "Esc" key: Quit program
  • Arrow Keys: Change particle stream direction
  • "x" key with left mouse button: Rotate model around x-axis
  • "y" key with left mouse button: Rotate model around y-axis
  • "z" key with left mouse button: Rotate model around z-axis

Resources

  • OpenGL.org
  • Nehe Productions
  • 3dcodingtutorial.com
  • Random Google-ing to find tutorials on collision detection

Video

This is my final project

Source

Final Project source files