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.

     

Leave a Reply