NOC – Week9: Particle System – Jingyi Zhu

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.

Nature of Code: Week 9 assignment–Moon(Candy)

Documented by: Candy Bi

Project name: Spring

Professor: Moon

Date: 4/16/2019

Link: https://editor.p5js.org/candy/present/Fa4vDtNzZ

Video: spring

The project of Spring is developed based on the demo we did in class. Instead of having two balls as objects. I created a class called balls and pushes them over the whole canvas. Each is connected to the two balls connected to it which I called “spring”. These lines would create force onto the balls they are connecting.

Then I add the function to check collision so that balls would feel more natural as with a mass. Collision checking and spring force then add to the interesting dynamic of those balls together.

For the interaction part, I keep the drag function and made the ball being dragged white so that it would be more clear to audience. Additionally, I add the function of key-pressed for sometimes drag is hard to control: balls would just fly away when mouse moves too fast out of the ball. The key-pressed function is only functioned on the first ball in the class to allow for free movements create by those springs.

NOC – Week 9: Particle Systems – Andrew Joslyn

Link: https://editor.p5js.org/adj311/sketches/FaBZAtC3F

Having not attended class, (and unclear lecture notes from the slides) I did my best to interpret the code as well as used some resources off Daniel Shiffman’s website and textbook to understand how particle systems worked for myself. I didn’t employ any use of springs or polymorphism, but I understand the concepts I think fairly intuitively from looking at the code. Particle systems seem like an important foundation for moving forward onto future topics, so I wanted to ensure that I understood their behavior and the code that drives them. For this sketch I just wanted to continue emphasizing interaction and wanted to create something similar to the example sketches in my own way, and ended up with a sort of “circles coming at you” effect. I’m not sure if I went about this in the right way, or if I even correctly used particle systems at all, but I think having not attended class this week’s sketch was a good effort.

(NOC)W9_Xiaonan: A Black Hole

Video: The Demo

Recently, the first photo of a black hole is “taken”, and finally we got to have a glimpse of this mysterious physical phenomenon. And I am fascinated by it, so this time I made a mini black hole.

It’s relatively simple, basically is using what we have learnt in class. For the outside “light” part, I created four objects of class Psystem, and for the inside dark part, I also created an object of that class, but when I run them, there is a small difference:

 

The parameter in run() function is the acceleration of the particle class. For the dark particles, I chose a very small acceleration so they may not escape from the center before they extinguish, which makes it look more like a circle inside, but dynamic.

Very Different from the real black hole, mine is continuing giving thins out, which is obviously against the physics’ law.  But right now I am  only able to write diffusion effect rather than contraction. 🙂

NOC – Week 9: Elastic Bracelets – Tiger Tian

Date: 04-16-2019

Click here to visit on p5 Web Editor

For this assignment, I utilized the concept of spring to make some elastic bracelets with p5. I also integrated the concept of particle system to create bead particles and spring particles within one bracelet instance. Every two beads that are next to each other have repulsion between one another, while the string between them constantly pulls them towards each other.

One difference I made to my project from the spring that we implemented in class is that, I wanted it to be more like a string, not a spring – that is, only when the stretch value is above 0 (actually stretched) would the spring work, and the two beads are pulled towards each other.

When you click on one of the beads to drag it, it turns red.