For this project, I will create a fireworks display. I will demonstrate a firework shell shooting into the sky, and at a certain point, the shell will explode in the sky. Once the explosion occurs, I will create particles shooting out of the shell. At first, the particles will be bright, then they will begin to fall and their color will fade away.
I began with the particles.cpp program and centered the water particles and made them shoot upward. This is where I was testing the gravity of the particles.
The next step I took was creating a particle shooting into the air. Once the particle burst, many water particles shot out. The goal here was to get the foundation of how my fireworks would behave.
Now that I had an idea of how the firework burst would behave, I began focusing on creating the firework particles. To make the particles, I created an array of 80 particles, and then used glBegin(GL_LINES) to loop through the array. What's happening here is OpenGL is drawing pairs of vertices to form line segments.
I went back and implemented the firework shell to imitate a firwork shooting into the sky.
Now it was time to bring some life to the firework. I added a colored burst for when the fireworks explode. This was done using a triangle fan. I also used alpha blending for the colored burst so that way the center of the explosion is bright and the outer edges of the explosion are more transparent. I also added a trail to the firework shell to better show the firework being launched into the air. I also shortened the burst radius of the firework. I also incorporated air drag to force the particles down.
I did not like how dark I made the color scheme of the fireworks. It was just too dark. Also, one big element that was missing was the flare like appearance for the firework particles. The flares were also made using a triangle fan. I went back and made the particles expolode in a much larger radius by increasing the speed at which they burst out. This lessened the effect of gravity on the system. I also made the program capable of firing shells in rapid succession. I also made the air drag element non existent.