NOC Week 9

link:https://editor.p5js.org/DianaXu/sketches/AZ8BCj8pn

Inspired by spring movement, I created a rising jellyfish. I changed the force between two balls, replaced the ball with sine waves, and added multiple legs.

I gave a force to the smaller balls to make them rise. And I also limited the force by giving an original distance to the springs and decreasing the value of k. Once I replaced the ball with sine waves, I added restrains on sine waves to make them look like legs. And in order to mimic the movement of a jellyfish, I restained the random value for the legs.

NOC – Week 9: Angry Chick – Spring (Lily)

For this sketch, I used the spring class we created in class to simulate “Angry Birds”. Once the chick is dragged, the spring will give it a force. And once the mouse is released, the spring will disappear and let go of the chick. The user can aim the chick at the pig and hit at it.

It seems that there is only one ball (the chick) in the sketch, but there are actually two. The difference between the spring I created and the spring we created in class is that the invisible ball is fixed at the center. 

Also, I added a function to the ball class, which is “fly( )”. When the mouse is released, the function will be triggered to check the distance between the chick and the center and to splice the spring. 

One problem that I am still not able to solve is that the chick will not be launched in the expected direction unless the spring is stretched to its fullest.

Demo

NOC – Week 9: Pinwheel & Flower Dance – Yunyu Zhang(Samantha)

  1. Apply lifespan and lifeReduction in class Particle and draw a quad in it by using (this.x1, this.y1, this.x2, this.y2, this.x3, this.y3, this.x4, this.y4) and then multiply the x and y positions by lifespan.
  2. In class PSystem assign rotSpeed and also x1, y1, x2, y2, x3, y3, x4, y4 to constructor(). Add this.scl to change the size of the quad. By using push new Particles, I made two quads that are symmetrical to each other by the y-axis whose positions are (this.x1, this.y1, this.x2, this.y2, this.x3, this.y3, this.x4, this.y4) and (-this.x1, this.y1, -this.x2, this.y2, -this.x3, this.y3, -this.x4, this.y4). 
  3. In function setup() I made four pair of quads that would together form a snowflake-like pattern through defining the values in pushing new PSystem. Also, assign these four groups with different rotSpeed.
  4. Then change the color of each pair of quads randomly through changing color in class PSystem.
  5. Adjust some of the values( eg. rotSpeed, color values, scale) to make better visual effects. 
  6. Played with this.acc in the constructor under class Particle and got two interesting versions.

Pinwheel: (the effect in this video is a bit different —- quad of the same color should appear in even number instead of odd number, from the original because the computer would get a bit stuck when doing screen-recording and the speed is arranged to be about 2 times faster than the original because of the size limit of uploading videos)

Flower Dance: (the speed of this video is arranged to be about 2 times faster than the original because of the size limit of uploading videos)

NOC – Week 9: Spring – Yang Gao

linkπŸ”—: https://editor.p5js.org/yg1273@nyu.edu/sketches/2a9e_pd8o

For this week’s assignment, I played with spring and made an animation using spring. Tom and Jerry move according to the noise function. To make Jerry turn left and right, I used subtraction and angle to get the direction and load different direction pictures.