Date: 04.16.2019
Link: sketches, fullscreen
For this week’s assignment, I made a sketch of four particle systems of polymorphic objects. The particles are generated at the four corners with an initial acceleration and are attracted by the mouse. When the mouse is pressed, the particles pause and are repelled by the mouse. The squares will rotate when the mouse is pressed, and the size of the circles will oscillate.
One problem I had was passing the right parameters to translate(). Since the origin is translated once when constructing the systems, the position of the mouse also need to be adjusted to the systems’ origins.
Another problem I had was that the calculation of the movement of particles was too heavy for my laptop. To prevent my laptop from overloading, I added noLoop() to exit the draw loop after a certain number of frameCount.