For this project, I created a couple different particle systems using Processing(Java). This was my first large graphics project and I hope you appreciate the quite humble start! There is a video example for each one as well as some information on features, benchmarks, roadblocks, and a link to source code.
1) Bouncing Balls
Source Code: Here
2) Water Fountain
Source Code: Here
3) Campfire
Source Code: Here
4) Fireworks
Source Code: Here
Features:
- Real-time, 3D graphics
- Change in color over lifetime
- Simple collision detection
- Simple smoke for fire and firework
Benchmarks:
- Bouncing balls – 510 spheres, 21FPS
- Water Fountain – 18000 points, 40FPS
- Campfire – 7500 points, 24FPS
- Fireworks – 13000 points, 50FPS
Roadblocks during creation:
- Bouncing Balls
- I used Processing’s built-in PVector class and was not aware that the built in functions like mult() and add() permanently changed the input vectors, rather than just giving me a value. Thus I had acceleration values of NaN or 0 for a good week.
- I tried to do too much when creating my extremely basic user camera and was adding translation values twice, three times, sometimes more.
- Water Fountain
- The water droplets used to extend outward in a square shape. Turns out that I was ignoring each points random radius and angle and just overriding with random velocities. After I fixed this, made the x and z components of each points velocity depend on their instantiated radius and sin/cos of their random angle, everything worked beautifully.
- Campfire
- I was trying a really long time to not just have a column of flame and instead represent somewhat of a candle. I was working with acceleration in the x and z direction but that was giving me issues such as the flames in the center of the disk emitter extended straight up and particles started grouping up on the x and z axis.
- The flame particles were extending out in a square shape. Turns out that I was ignoring each points random radius and angle and just overriding with random velocities. After I fixed this, made the x and z components of each points velocity depend on their instantiated radius and sin/cos of their random angle, everything worked beautifully.
- Firework
- The hardest part of this was creating a spherical explosion. I had to “learn” some 3D vector math. En-route to the finished product, I had circles, cones, 3/4 spheres, and hemispheres.
- I also was trying to figure out a way to make the fireworks more realistic, to give them some sparkle. I was trying tons of different combinations of random color combination until I tried giving each particle a slight chance at turning white each update. I loved how it gave the fireworks a realistic sparkle.