Particle Systems § Uses a large number of very small graphic objects to simulate "fuzzy" phenomena § Examples: fire, explosions, smoke, moving water (such as a waterfall), sparks, falling leaves, rock falls, clouds, fog, snow, dust, meteor tails, stars and galaxies
Implementation § Emitter: a source of particles § Particles behavioral parameters a) spawning rate: how many particles are generated per unit of time b) initial velocity vector: the direction they are emitted upon creation c) lifetime: the length of time each individual particle exists before disappearing a) color b) etc. § Most parameters are "fuzzy" — instead of a precise numeric value, it is specified a central value and the degree of randomness allowable on either side of the central value.
Particle System | frame time void init_frame_timer() { LONGLONG rate; // Counts per second: 2,435,913 if (!QueryPerformanceFrequency((LARGE_INTEGER*)&rate)) return; if (!rate) return; // Improved value if nothing fail (returned) frequency = 1.0f / (float)rate; // Time stamp (performance-counter value): 27 929 379 692 if (!QueryPerformanceCounter((LARGE_INTEGER*)&start_clock)) return; }
Bonus Point to be added to your final grade: a) +1 for a simple implementation of fire changing particles color and/or size and emulating smoke and flames. Such as in the image here b) +3 for a realistic implementation of fire. Something similar the image here : colors, blending (transparency), improved physics, lighting. c) +5 for a WoW implementation. Additional programming is needed. Something equal or better than the image here * In all cases we are talking about a fire in 3D – it is not flat.