This week’s assignment is about utilizing vectors and transformation functions to create sketches. What I created is called “Spiral Particles”, which constantly emits particles spinning in a spiral movement and gradually fades away. I also found two similar projects as my inspirations.
First, I used OOP to create a class for constantly generating particles. I used translate() to transform the coordination of (0, 0) to the center of the window. I also set a condition of “(frameCount % 15 == 0)” to control the intervals of emitting particles. By putting the translate() along with all of the codes that control the class Particle() inside a push() and pop() functions, I can then display the number of particles using the original coordination and put it at the top left corner of the window.
Then, for the class Particle(), I created three vectors to control the position, velocity, and acceleration of the particles. I also used the map() function to limit the color and transparency of particles within a certain range, and used the add() and limit() for the calculation of vectors. The final outcome looks like this:
References: