{"id":485,"date":"2012-11-12T17:15:56","date_gmt":"2012-11-12T17:15:56","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=485"},"modified":"2012-11-16T02:49:33","modified_gmt":"2012-11-16T02:49:33","slug":"nature-2","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/nature-2\/","title":{"rendered":"Nature 2"},"content":{"rendered":"<p>I find a lot of inspiration in trees. For this piece I wanted to give the user the ability to plant a forest&#8230;sort of. The idea is that a tree is created in a random shade of green, with a height based on where the mouse is when it is clicked. The only part of this that still bothers me is that if you click to create a small tree, which would appear to be off in the background, it will appear on top of larger trees in the foreground.<\/p>\n<p>PImage myPicture;<br \/>\nPImage myPicture2;<br \/>\ncolor myColor;<\/p>\n<p>void setup() {<br \/>\n  size(500, 400);<br \/>\n  myPicture2 = loadImage(&#8220;http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/11\/background.png&#8221;);<br \/>\n  background(myPicture2);<br \/>\n  myPicture = loadImage(&#8220;http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/11\/tree.png&#8221;); \/\/load this image file (must be in same directory as sketch)<br \/>\n  \/\/when sketch is online, put a URL for the image, which must be on same server as sketch)<br \/>\n  imageMode(CENTER);<br \/>\n}<\/p>\n<p>void draw(){<br \/>\n}<br \/>\nvoid mousePressed(){<br \/>\n  myColor=color(random(150,220));<br \/>\n  tint(myColor);<br \/>\n  image(myPicture,mouseX,400-height\/2,80,mouseY);<br \/>\n}<\/p>\n<p>I\u2019m unable to get my projects to load properly on the blog currently, so I\u2019m just going to post the code for the time being, and will probably upload a screen shot later or something to show what it should look like when working.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I find a lot of inspiration in trees. For this piece I wanted to give the user the ability to plant a forest&#8230;sort of. The idea is that a tree is created in a random shade of green, with a &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/nature-2\/\">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\/485"}],"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=485"}],"version-history":[{"count":6,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/485\/revisions"}],"predecessor-version":[{"id":704,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/485\/revisions\/704"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}