-
Notifications
You must be signed in to change notification settings - Fork 18
Homework 2
Daniel Shiffman edited this page Mar 15, 2017
·
53 revisions
- Physics and Forces
- Next week we will look at both Chapter 3 and Chapter 4 from The Nature of Code. After you finish your homework, if you have some extra time, you might scan over the text or watch a few of the videos in advance. It's a lot of material so I'm just going to cover a few key aspects in class.
- Tues Particle Physics
- Tues Particle Attraction
- Wed Particle Attraction Processing
- Wed Particle Attraction p5.js
- Noise Path 1
- Noise Path 2
- Rework your motion sketch from week 1 using vectors (
PVector
in Processing,p5.Vector
in p5). Try incorporating the concept of forces into the environment by affecting only the acceleration. Create a formula for calculating a dynamic acceleration, one that changes over time based on any number of factors. What happens if you make more than one object via an array. - Using forces, simulate a helium-filled balloon floating upward (and bouncing off the top of a window). Can you add a wind force which changes over time, perhaps according to Perlin noise?
- Create an example where instead of objects bouncing off the edge of the wall, an invisible force pushes back on the objects to keep them in the window. Can you weight the force according to how far the object is from an edge, i.e. the closer it is, the stronger the force?
- Create pockets of air resistance / friction in a p5 sketch. Try using circles instead of rectangles, i.e. pockets of mud (or ice). What if you vary the strength (drag / friction coefficient) of each circle? What if you make some of them the opposite of drag—i.e., when you enter a given pocket you actually speed up instead of slow down?
- Can you create an example where all of the Mover objects are attracted to the mouse, but repel each other? Think about how you need to balance the relative strength of the forces and how to most effectively use distance in your force calculations.
- Research a force not covered in class and implement it as a vector.
- Use the concept of forces to visualize some input (could be data, literal example would be get windspeed online and translate to a wind force in p5, but feel free to think more abstractly)
- Build a sketch that has both "Movers" and "Attractors". What if you make the Attractors invisible? Can you create a pattern / design from the trails of objects moving around attractors? See the Metropop Denim project by Clayton Cubitt and Tom Carden for an example.
- Model the terminal velocity of a cat.
- Document your work on the web and link to it below.
- If you are using Processing or some other offline tool, add a copy of your work to our shared Google Drive folder. If you are using the p5.js web editor or other online editor like codepen, you do not need to share your code this way.
- Try to post by the evening before class if at all possible.
- Add any questions below.
- your question here -- your name (optional)
- an answer will appear here
- What is the difference between
setMag()
andlimit()
?- Let's say
v
has a magnitude of 5.v.setMag(10)
--> a magnitude of 10.v.limit(10)
--> a magnitude of 5.limit()
only sets the magnitude to that number if it exceeds the value whereassetMag()
always sets the magnitude to the number.
- Let's say
- Alex - Using the Force
- Anne - Button Bounce, Click to Grow, Many Bouncing Buttons
- Corbin - click around
- Daniel -documentation and just the thing (needs chrome to use audio input)
- Grau - forces
- Jinhee - blog
- Diana -Blog
- Manning - Green Light
- Miao -
- Pan - drop a ball
- Paula - (http://www.paulaleonvendagar.com/wp-admin/post.php?post=659&action=edit)
- Steven - Homework 2
- Mint - Code,Blog
- Shelley - Force
- Tong - Chasing
- Teresa -Foraging
- Luqian - week2
- Aaron -
- Ada - Particles and Attractors
- Daniella - symmetry
- Danni - mesh
- Dong Chan -
- Ji Young - Black Snakes
- Pilar - Siamese Deer Squabble
- Michael - Wind and Gravity
- Oriana - [http://alpha.editor.p5js.org/full/Sk3YFeI9x]
- Tiri - Firework
- Utsav - Moving Mandala, code
- Yun - Leaves and Drops
- Yuqiao -star cloud
- Zhuoxi - Hairdryer and balloons