NOC W4

I created a feather falling scene. It has two interactions input: MouseX position and mousePressed. MouseX is mapped to the force of the wind. When the speed of feather increases, the resistance force will also increase( but always smaller than gravity). When the mouse is pressed, the feather will be blown up.

There are two difficult parts of this assignment. The first is to measure the size of the feather, and the second is to add resistance. 

NOC-Week 4: Slide On Ice – Force (Lily)

The environment that I have built in this sketch is a rock falling down from above onto the ice. 

Based on the sketch we made last week in class, I added a condition to check the boundary of ice so that the rock can stop when it hits the ice. Originally, I intended to add a support force that was the opposite of the gravity, but that did not work. Moon suggested using restitution, flipping and decreasing the velocity after each collision.

With the wind function, one can move the rock on the ice based on the mouse X position. There is also the resistance of the ice so that the speed of the rock will gradually decrease.

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

Documented by: Candy Bi

Project name: Slope

Professor: Moon

Date: 3/12/2019

Description:

I made a solid slope for assignment 4 which would make the balls bouncing on it. The slope is made as a single line.

To create the effect of balls bouncing on a solid slope, I caculate the angle of the slope and add a force verticle to it to those balls. At first, I just check the position of the balls relevent to the slope and the balls seem to be half-inside the slope: 1.

To make it more natural, I put the “p.size” into my calculation: 2.

Then I make the balls transparent to make it looks prettier: 3.

NOC – Week 4: Physical Environment – Tiger Tian

Date: 03-12-2019

Click here to visit on P5 Web Editor

Personally, I really liked this week’s topic, because it begins to reveal the essence of the course name! What I did after class this week is similar to what we did in class. It has the wind method controlled by mouse X position, and buoyancy based on Y position. I also added a few other features to make it more interesting.

Besides water, I added an oil layer, whose density is smaller than water, so it floats above water. Thus there are three possible states for a particle: floating on oil, floating under oil and on water, and staying at the bottom of water. Which state a particle is in is determined by its density, which is why I added density to each particle. It is a random value, just like the size of each particle. Now that we have both size and density, we can calculate its mass by simply multiplying them (technically, mass = density * volume, and sphere volume = 0.75 * pi * radius cube, so if I were to be accurate, it would be m = ρ * 0.75 * pi * (size / 2) ^ 3. But here I omitted the complicated calculations). Then I added colors to the particles to indicate the density of each of them, using the map() function. The lighter the color, the smaller the density.