{"id":1009,"date":"2015-10-21T02:20:29","date_gmt":"2015-10-21T02:20:29","guid":{"rendered":"http:\/\/blogs.discovery.wisc.edu\/projects\/?p=1009"},"modified":"2015-10-21T03:50:29","modified_gmt":"2015-10-21T03:50:29","slug":"week-7-forces","status":"publish","type":"post","link":"https:\/\/blogs.discovery.wisc.edu\/projects\/2015\/10\/21\/week-7-forces\/","title":{"rendered":"Week 7 &#8211; Forces"},"content":{"rendered":"<p>This week&#8217;s topic was Forces and simulating forces in the Processing environment. The main content from now on will come from &#8220;The Nature of Code&#8221; as I have finally learned all of the basics to the language and I am finally making particle simulations. The downside is that now things are more complex and even though I was able to swift through a lot of the preliminary content, I am finding myself getting stuck a lot more.<\/p>\n<p>In any case, let me give a brief run on the forces that we looked at in Chapter 2 of &#8220;The Nature of Code&#8221;. We now have the PVector class that we know how to use so we can begin to use Physics to model motion under acceleration. Since Processing&#8217;s basic unit is a pixel, the distance units become pixels and the velocity units become pixels per frame. The chapter gave me a brief intro into classical mechanics with Newton&#8217;s Laws. We looked at gravitational force, friction forces and drags. But these end up being an approximation. The world we are simulating in Processing doesn&#8217;t really stand a chance against more sophisticated physics algorithms. Instead, what we should strive to do with simulations is to make them &#8220;look&#8221; like they are something.<\/p>\n<p>For this weeks project I incorporated forces into the Particle String composition from week 7. This took me a long time to get right. Rather than use a force as described in the book, I decided to make up a force that would the particles stick to the sides of the window. The result feels like a viscous fluid splattering inside a box. Notice that if you keep the left mouse button pressed as you move your cursor around, the particles create a string, almost like a snake that follows the cursor. This was accomplished by incrementally setting up the the limiting velocity for each particle. The composition can be seen <a href=\"http:\/\/www.openprocessing.org\/sketch\/224036\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s topic was Forces and simulating forces in the Processing environment. The main content from now on will come from &#8220;The Nature of Code&#8221; as I have finally learned all of the basics to the language and I am &hellip; <a href=\"https:\/\/blogs.discovery.wisc.edu\/projects\/2015\/10\/21\/week-7-forces\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":105,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/1009"}],"collection":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/users\/105"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/comments?post=1009"}],"version-history":[{"count":3,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/1009\/revisions"}],"predecessor-version":[{"id":1012,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/1009\/revisions\/1012"}],"wp:attachment":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/media?parent=1009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/categories?post=1009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/tags?post=1009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}