This week’s assignment was to work with particle systems. In class we were able to build an emitter and a couple different types of particles. I wanted to try to create a few different types of particles that were attracted to particles of the same type. I also wanted to eliminate particles through merging rather than simply deleting them when they went off screen. Ultimately I was able to get three different color circles to randomly emit, attract to like colors, and form larger and larger merged particles. However I did have some difficulty implementing the prototyping method we learned beyond simple rendering changes. I think with more time I could significantly shrink the code.
I first moved the emitter around the screen and played with some of the properties. I was able to make some firework looking things pretty quickly.
Once I refamiliarized myself with the code I set out creating three distinct types of particles (indicated by color). I implemented separate attraction gravity for each color.
After wrestling with this for a while I was then able to create the merging effect I was looking for and replaced the .isDead() function.
Lastly I applied separate x,y gravity forces to each color and got the emitter to move around with the mouse.
This is where I sort of hit the wall and ran out of time. That being said, I really liked making a sketch that starts off kind of chaotic and random but will eventually stabilized to a predictable outcome each time. I’m really looking forward to being able to make these particles “smarter”.
sketch: