Week 8
Today:
Hexapod (land jellyfish) by Zenta
Soft robot jellyfish by Jennifer Frame + team
“A particle system is a collection of many many minute particles that together represent a fuzzy object. Over a period of time, particles are generated into a system, move and change from within the system, and die from the system.” —William Reeves, “Particle Systems—A Technique for Modeling a Class of Fuzzy Objects,” ACM Transactions on Graphics 2:2 (April 1983)
A single particle object is just another name for our mover. A particle has a positon, velocity and acceleration.
We can start with the basics of the mover class we made earlier. Now we’ll add one more method to the class called lifespan().
Our particle system will also have a emitter, which creates the initial settings for the number of particles, location, velocity, etc.
The emitter will create particles, give them a lifespan, and continue to create particles throughout the run of our program.
In our first example we’ll start the lifespan at 255 and count down to 0. This value will also count as the alpha channel, so the particle is getting more transparent, and when it reaches 0 it will be dead. We have a method to check whether the individual particle is alive or dead.
We have a run method that runs display and update (move). The particle has an initial velocity and downward acceleration (simulating gravity).
Last week we covered ways to expand and splice arrays of objects/particles in Javascript.
In the example code there is a for each statement.
“For each Particle p in particles, run that Particle p!
Array of Particles code
Implications: Building a system of creatures in our ecosystems. Using particle system and lifespan ideas, can you implement birth, lifespan (possibly tying it to a resource like food), death, a emitter that creates creatures if they are spawned from a particular location, polymorphism and inheritance to create a variety of creatures…
Textile Cone Snail
The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves, or, for advanced players, by creating patterns with particular properties. The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970
Conway’s Game of Life - p5js code