NOC: HW6 & Midterm Proposal Slides – Ji Hwan Shin

Link to code: https://editor.p5js.org/jihwanshin96/sketches/quRyhOjtc

Link to ppt: https://docs.google.com/presentation/d/1bPAoklxJha6gEeJqADsru1RmpAS3vR6W7ZY1D9AkBCM/edit?usp=sharing

For this week’s assignment, I wanted to play around with attractions and forces. I thought it’d be interesting to try to emulate the rings of a planet revolving around. So I placed an ellipse in the center and manipulated the particles to be attracted to the center sphere. But I must have written something wrong in declaring the class particles because it would not recognize various functions like force, attraction, or gravity. I implemented the methods I learned in class but had some trouble getting the code to work. In the end, I wasn’t able to achieve my desired result but I will keep tweaking the code to see what I did wrong.

**Update**

I realized that the ellipse has to be a particle with a specific mass for gravity to work around it. But I still wasn’t able to get a rotating orbit, more like a black hole.

NOC – Week 6 – Yunyu Zhang(Samantha)

  1. Draw a center ball that applies the sin() function which makes it have a glowing effect. For a natural visual experience of this glowing ball, put frameCount inside the sin() function and makes it smaller so that the ball would not glow(becoming small to big and small again) crazily fast. Then adjust the expression by adding and multiplying certain numbers to make the difference between the biggest and smallest size obvious. 
  2. Create a set of balls and use applyAttraction() and applyRepulsion() to make the balls being attracted and repulsed from the center ball.[adding “this.POS = (createVector(width / 2, height / 2);” to apply it in these funtions in order to do vector substitution]
  3. Use checkCollision(other) to add colliding effects among the balls.
  4. Inside function draw(), put applyRepulsion() and checkCollision(other) under the condition that the mouse is pressed. And put applyAttraction() under the opposite condition so that the balls would first be attracted to the center ball and then move quickly away from it when the mouse is clicked. Inside the checkCollision(other) function, the balls would change colors randomly once they collide with another ball.
  5. Make the canvas fullscreen to improve visual effect.

     

(NOC) HW6 – Xiaonan Li

Here is the link of my hw6:

https://drive.google.com/open?id=1OADlrDF2xEMzEhg7pOFDvmIH-BuKZnek

https://drive.google.com/open?id=1CM0sOsb0V3rFNNz_2eGo5H6qBsCSLaDJ

 

As it is showed in the picture, the purpose of the user is to move the blue earth around and to collide three other planets away to protect our sun. The earth is fixed on the specific track and it can move along with it with user’s mouse. The collision of the earth and the white planet is through function checkCollision().

Besides, the sun has attraction towards the three white planet, and since it has huge mass, its position barely changes. So simply saying, the earth has to protect sun from keeping coming planets, and the collision between sun and the white planet will result to a failure of the game.

Another fun fact is that I give our sun eyes and he will keep staring at the earth and watch it to check if it is doing a good job.