Inspiration:
When I think of confetti I think of celebrations, and birthdays and the joy and laughter that comes with it! Interestingly, the way confetti moves in air when it is first released from its container is a very sudden and quick movement, which if you arent paying close attention to, you could easily miss. Which is why I began to think of how I can better visualize such confetti, and what would make this movement slow down, so we can visualize this motion and its changes more clearly.
Concept:
The concept of this program mainly revolves around a simulation of a flock of confetti, which are simple agents that move similarly to confetti with a more limited speed. The main classes are Flock and Boid(confetti). The Flock class manages a list of confetti instances and has methods to simulate the collective behavior of the collection and add more confetti.
The behavior of the flocking revolves arounf three main principles/rules: separation, alignment, and cohesion. The flock method in the Boid class calculates forces for each of these principles based on the positions and velocities of neighboring boids/confetti particles. These forces are then applied to the boid’s acceleration, influencing its movement. The update method handles the adding of acceleration to update the boid’s position and velocity. The display method visually represents each boid as a neon-colored dot with a line trace, creating a dynamic simulation.
Program With Comments:
Reflection:
As I concluded this program I began to wonder how I could further advance this program visually, which is when I thought of the methods we learnt about last week and how they can really push this program. For instance, a more dramatic separation steering behavior is particularly suitable for this program, because it serves to keep the confetti from clumping together.