{"id":251,"date":"2012-11-05T09:13:35","date_gmt":"2012-11-05T09:13:35","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=251"},"modified":"2012-11-05T09:16:12","modified_gmt":"2012-11-05T09:16:12","slug":"251","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/05\/251\/","title":{"rendered":"Ben Ouimet&#8217;s Processing HW 2"},"content":{"rendered":"<p>For the second homework I edited my simple snowman picture in processing to be a little more exciting. The center snowball grows to its full size, while the lowest ball appears when the mouse is clicked. The head and eyes are re-drawn with a different background (a slight grey) when the mouse is on different sides of the screen. I found a little trouble with the stroke on the middle circle overlapping the top circle making it look a bit off, but as the top circle is dedrawn every time the mouse passes the center line, once the middle circle has reached it&#8217;s max size the top circle will remain on top.<br \/>\n<script type=\"application\/processing\">\r\nint diam=10;\r\nfloat centX, centY;\r\nvoid setup(){\r\n  size(500,500);\r\n  background(0);\r\n  frameRate(24);\r\n  smooth();\r\n  centX=width\/2;\r\n  centY=height\/2;\r\n  \r\n}\r\nvoid draw(){\r\nstroke(2);\r\nif (mouseX < width\/2){\r\n  fill(255);\r\n  ellipse(250,175,105,105);\r\n  fill (0);\r\n  ellipse(220,175,20,20);\r\n  ellipse(280,175,20,20);\r\n} else {\r\n  fill(127);\r\n  ellipse(250,175,105,105);\r\n  fill(0);\r\n  ellipse(220,175,20,20);\r\n  ellipse(280,175,20,20);\r\n}\r\n{\r\n  if (diam<=150){\r\n    fill(255);\r\n    ellipse(centX,centY,diam,diam);\r\n    diam+=10;\r\n  }\r\n}\r\n}\r\nvoid mousePressed(){\r\n  stroke(255);\r\n  fill(255);\r\n  ellipse(250,375,220,220);\r\n}\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the second homework I edited my simple snowman picture in processing to be a little more exciting. The center snowball grows to its full size, while the lowest ball appears when the mouse is clicked. The head and eyes &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/05\/251\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/251"}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=251"}],"version-history":[{"count":10,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":263,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/251\/revisions\/263"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}