In this assignment you will create some particle systems. Students in the Silicon Valley section must use the C++ language and the SFML library for this homework assignment.
The following resources may be of help in performing this assignment:
Building an Advanced Particle System, John van der Burg
Chapter 4: Particle Systems, in The Nature of Code, Daniel Shiffman
In this assignment, you will create the following particle systems, with increasing levels of complexity.
1. Simple points. In this particle system, each of the particles is a simple point, and has an emitter fixed at a specific location. Each particle has a fixed velocity, direction, and lifetime which are randomly assigned at time of creation. The program must have a way to increase and decrease the total number of particles (such as via keypresses: see this SFML tutorial on handling keyboard input) while the particle system is running. Explore how many particles can you have before your system slows down!
The tutorial code shown on this SFML tutorial page accomplishes everything except for the growth/shrinking of the number of particles.
2. Gravity. Change the particles so they have a gravity (an acceleration), and the emitter only emits particles in a specified range of angles.
3. Shapes. Modify the particles so that they are a textured polygon.
4. Multiple particle systems. Allow multiple particle systems to be active at the same time, each with a different emitter location, speed, range of angles, and each with a different visual effect.
Performing the above is sufficient for a B grade (passing this homework assignment). For an A grade do one of the following (5-9), and for an A+ grade, do two of the following (5-9) or one of 10 or 11 (which are sufficiently complex that doing just this alone is a very challenging extra assignment)
5. Add a repellor/attractor. Make it possible to add one or more repellor/attractor elements to the simulation. A repellor/attractor repels/attracts particles to a fixed point at a specified acceleration. See Section 4.12 of Chapter 4: Particle Systems for a discussion of repellor/attractors and how to implement them in a way that is minimally intrusive to the particle.
6. Add trails. Record (part of) the history of motion of each particle, and visually represent this trail. Small particles and narrow trails can create fireworks-like effects, while wider particles and trails create a streamer or banner type effect.
7. Create a compelling explosion effect. Explosion effects involve a combination of multiple particle systems, each centered at the source of the explosion. Each system contributes to the overall aesthetics of the explosion.
8. Create a compelling spaceship exhaust effect. Interesting spaceship exhaust effects usually combine multiple particle systems together (each with varying sizes and visual properties) to make for an interesting and compelling exhaust trail.
9. Create a rain or snow effect. This involves changing the particle system so the emitter is a line, rather than a point, and particles typically are small, with trail length varying depending on desired aesthetics of the rain or snow effect.
10. Create a dissolve effect. A compelling visual effect can be created by having a formerly solid object in the game world be converted into particles, which either fall away, or are blown away (see Particle Dissolve with Trapdoor for an example). Create your own particle dissolve effect, and demonstrate it by having some object dissolve away. Be sure to vary the size and shape of the dissolving particles to add visual interest.
11. Create a smoke effect using a fluid simulation. Using lightweight fluid simulation effects (see: Practical Fluid Dynamics and Fluid Simulation for Dummies for implementation ideas).
Homework submission.
For the code you have written, create and share with me a GitHub repository, following the instructions in Homework General Information.
Additionally, if you perform one of the advanced projects (#5-11), additionally create a short YouTube video and share the link by adding it to this shared document in the class Google Drive folder: Homework #1