6.837 Intro to Computer Graphics
Assignment 9: Particle Systems

In this assignment you will play around with Particle Systems. In the new code base, we provide the GLCanvas and System classes that manage the user interface and a dynamically-resizeable set of particles (Particle and ParticleSet). The System::Update method is called at a regular time interval (provided on the command line as the option -refresh <seconds>). The Update function advances the simulation forward in time (by the amount specified with the command line option -dt <seconds>).

Once the particle system has been launched you can interact with it through a simple gui. Use the mouse to rotate or zoom the scene. Hit 'p' to pause the simulation, and 'p' again to unpause it. When paused you can hit 's' to perform a single step of integration. You can also restart the simulation by hitting 'r'. To restart the system, all existing particles are deleted and any state stored within the system (including all random number generators) should be reset. We provide a simple random number generator class (see random.h) which generates a reproducible stream of pseudo-random numbers. By using the Random class instead of drand48() you can use multiple identical random number streams to directly compare various particle system options (the velocity or position randomness, the integration scheme, etc.)

You can also specify various rendering options at the command line. By default each particle is drawn as a large dot of the particle's current color. The -integrator_color option colors the particles based on integration scheme. The -draw_vectors <acceleration_scale> option draws the velocity vector in the same color as the particle, and a scaled version of the acceleration vector in white. This should be helpful when debugging your force fields and your integration scheme. Finally the -motion_blur option draws a thin line between the particle's current position and its last position.

Tasks

References

Ideas for Extra Credit

New Code Base for this Assignment

You may modify these files as you wish, but you should only need to create the new classes described above.

Input Files

Sample Results

particle_system -input system9_01_hose.txt -refresh 0.1  -dt 0.1 
particle_system -input system9_01_hose.txt -refresh 0.05 -dt 0.05
particle_system -input system9_01_hose.txt -refresh 0.1  -dt 0.1  -motion_blur
particle_system -input system9_01_hose.txt -refresh 0.05 -dt 0.05 -motion_blur

particle_system -input system9_02_hose_gravity.txt -refresh 0.05 -dt 0.05 -draw_vectors 0.1
particle_system -input system9_02_hose_gravity.txt -refresh 0.05 -dt 0.05 -motion_blur

particle_system -input system9_03_hose_force.txt -refresh 0.05 -dt 0.05 -draw_vectors 0.1
particle_system -input system9_03_hose_force.txt -refresh 0.05 -dt 0.05 -motion_blur

particle_system -input system9_04_circle_euler.txt -refresh 0.1  -dt 0.1  -integrator_color -draw_vectors 0.02
particle_system -input system9_04_circle_euler.txt -refresh 0.05 -dt 0.05 -integrator_color -motion_blur
particle_system -input system9_04_circle_euler.txt -refresh 0.01 -dt 0.01 -integrator_color -motion_blur

particle_system -input system9_05_circle_midpoint.txt -refresh 0.1  -dt 0.1  -integrator_color -draw_vectors 0.02
particle_system -input system9_05_circle_midpoint.txt -refresh 0.05 -dt 0.05 -integrator_color -motion_blur
particle_system -input system9_05_circle_midpoint.txt -refresh 0.01 -dt 0.01 -integrator_color -motion_blur

particle_system -input system9_06_circle_rungekutta.txt -refresh 0.1  -dt 0.1  -integrator_color -draw_vectors 0.02
particle_system -input system9_06_circle_rungekutta.txt -refresh 0.05 -dt 0.05 -integrator_color -motion_blur
particle_system -input system9_06_circle_rungekutta.txt -refresh 0.01 -dt 0.01 -integrator_color -motion_blur
Implementation of the Runge Kutta integrator is optional (extra credit).

particle_system -input system9_07_wave.txt -refresh 0.01 -dt 0.2  -integrator_color -motion_blur
particle_system -input system9_07_wave.txt -refresh 0.01 -dt 0.05 -integrator_color -motion_blur
particle_system -input system9_07_wave.txt -refresh 0.01 -dt 0.01 -integrator_color -motion_blur
Implementation of the Runge Kutta integrator is optional (extra credit).

particle_system -input system9_08_fire.txt -refresh 0.05 -dt 0.05  -motion_blur

particle_system -input system9_09_wind.txt -motion_blur -dt 0.05 -refresh 0.05
Implementation of the Wind force field is optional (extra credit).

See the main Assignments Page for submission information.