Skip to content
Daniel Shiffman edited this page Mar 15, 2017 · 53 revisions

Review

In-class Examples

Assignment: Choose one or create your own.

  • 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.

Directions

  • 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.

Questions

  • your question here -- your name (optional)
    • an answer will appear here
  • What is the difference between setMag() and limit()?
    • 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 whereas setMag() always sets the magnitude to the number.

Post your work - Wednesday Section!

Post your work - Tuesday Section!