{"id":444,"date":"2012-11-11T23:23:35","date_gmt":"2012-11-11T23:23:35","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=444"},"modified":"2012-11-11T23:26:37","modified_gmt":"2012-11-11T23:26:37","slug":"nature-image-1-blooming-roses","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/11\/nature-image-1-blooming-roses\/","title":{"rendered":"Nature image 1- blooming roses"},"content":{"rendered":"<p>For this image I made a set of 4 roses bloom over time. This was somewhat tricky to get correct and involved a lot of playing around to figure out the best way to get it to look right. At any point you may press the mouse key to restart. I made the fill have a lower alpha so the roses would be darker towards the center and lighter towards the delicate outer petals. The fill colors are fully saturated and the strokes are a solid version of the fill color, which I feel makes the flowers look like they are glowing against the hunter green background. I thought the dark green looked majestic and was fitting for the roses. I used both dark and light along with cool and warm going from red to teal to pink to indigo. I played around a lot with the color choices and thought the ones I picked came out nicely.<\/p>\n<p><script type=\"application\/processing\">\r\nVertex p1;\r\nVertex p2;\r\nVertex p3;\r\nVertex p4;\r\nVertex p1start;\r\nVertex p2start;\r\nVertex p3start;\r\nVertex p4start;\r\nint petalRows;\r\nint timesSinceBloom;\r\nint roses;\r\ncolor fillC;\r\ncolor strokeC;\r\n\r\nvoid setup(){\r\n  size(580,400);\r\n  background(0,50,0);\r\n  p1 = new Vertex(80,80);\r\n  p2 = new Vertex(100, 100);\r\n  p3 = new Vertex(80, 120);\r\n  p4 = new Vertex(60, 100);\r\n  p1start = p1;\r\n  p2start = p2;\r\n  p3start = p3;\r\n  p4start = p4;\r\n  petalRows = 0;\r\n  fillC = color(255,0,0,90);\r\n  strokeC = color(255,0,0);\r\n  bloom();\r\n  timesSinceBloom = 0;\r\n  roses = 0;\r\n}\r\n\r\nvoid draw(){\r\n  \r\n  if(petalRows == 6 && roses < 3){\r\n    roses++;\r\n    petalRows = 0;\r\n    if(roses == 2){\r\n      fillC = color(255,0,255,90);\r\n      strokeC = color(255,0,255);\r\n    }\r\n    else if(roses ==3){\r\n      fillC = color(0,0,255,90);\r\n      strokeC = color(0,0,255);\r\n    }\r\n    else if(roses == 1){\r\n      fillC = color(0,255,255,90);\r\n      strokeC = color(0,255,255);\r\n    }\r\n    p1 = p1start;\r\n    p2 = p2start;\r\n    p3 = p3start;\r\n    p4 = p4start;\r\n    p1.xPos = p1.xPos + 140;\r\n    p2.xPos = p2.xPos + 140;\r\n    p3.xPos = p3.xPos + 140;\r\n    p4.xPos = p4.xPos + 140;\r\n    p1start = p1;\r\n    p2start = p2;\r\n    p3start = p3;\r\n    p4start = p4;\r\n    print(fillC + \" \" + strokeC + \"\\n\");\r\n  }\r\n  if(timesSinceBloom == 30){\r\n    bloom();\r\n    timesSinceBloom = 0;\r\n  }\r\n  else{\r\n    timesSinceBloom++;\r\n  }\r\n}\r\n\r\nvoid bloom(){\r\n  if(petalRows == 0){\r\n    stroke(0,255,0);\r\n    fill(200,255,200);\r\n    Vertex stem = new Vertex(p3.xPos, p3.yPos);\r\n    for(int i = 0; i < 10; i++){\r\n      if(i%2 ==0){\r\n        Vertex temp = new Vertex((stem.xPos + 30),(stem.yPos + 40));\r\n        line(stem.xPos,stem.yPos,temp.xPos,temp.yPos);\r\n        stem = temp;\r\n        \/\/make thorn\r\n        temp = new Vertex((stem.xPos + 5),(stem.yPos -5));\r\n        Vertex temp2 = new Vertex((temp.xPos - 10), (temp.yPos - 3));\r\n        beginShape();\r\n        vertex(stem.xPos, stem.yPos);\r\n        vertex(temp.xPos,temp.yPos);\r\n        vertex(temp2.xPos,temp2.yPos);\r\n        endShape(CLOSE);\r\n      }\r\n      else{\r\n        Vertex temp = new Vertex((stem.xPos - 30),(stem.yPos + 40));\r\n        line(stem.xPos,stem.yPos,temp.xPos,temp.yPos);\r\n        stem = temp;\r\n        \/\/make thorn\r\n        temp = new Vertex((stem.xPos - 5),(stem.yPos -5));\r\n        Vertex temp2 = new Vertex((temp.xPos + 10), (temp.yPos - 3));\r\n        beginShape();\r\n        vertex(stem.xPos, stem.yPos);\r\n        vertex(temp.xPos,temp.yPos);\r\n        vertex(temp2.xPos,temp2.yPos);\r\n        endShape(CLOSE);\r\n      }\r\n    }\r\n  }\r\n  stroke(strokeC);\r\n  fill(fillC);\r\n  petalRows++;\r\n  if(petalRows < 6){\r\n    beginShape();\r\n    vertex(p1.xPos,p1.yPos);\r\n    vertex(p2.xPos, p2.yPos);\r\n    vertex(p3.xPos, p3.yPos);\r\n    vertex(p4.xPos, p4.yPos);\r\n    endShape(CLOSE);\r\n    if(petalRows%4 == 1){\r\n      \/\/don't edit the actual values yet because you need to\r\n      \/\/refernce them for other vertexes\r\n      Vertex p1Temp = new Vertex(p2.xPos,p1.yPos);\r\n      Vertex p2Temp = new Vertex(p2.xPos,p3.yPos);\r\n      Vertex p3Temp = new Vertex(p4.xPos,p3.yPos);\r\n      Vertex p4Temp = new Vertex(p4.xPos,p1.yPos);\r\n      \/\/now you can change the values\r\n      p1 = p1Temp;\r\n      p2 = p2Temp;\r\n      p3 = p3Temp;\r\n      p4 = p4Temp;\r\n    }\r\n    else if(petalRows%4 == 2 || petalRows%4 == 0){\r\n      int dist = (p2.yPos - p1.yPos)\/2;\r\n       \/\/You don't need temp for these because they don't effect the others.\r\n      p1 = new Vertex((p1.xPos +dist), (p1.yPos +dist));\r\n      p2 = new Vertex((p2.xPos - dist),(p2.yPos + dist));\r\n      p3 = new Vertex((p3.xPos - dist),(p3.yPos - dist));\r\n      p4 = new Vertex((p4.xPos + dist),(p4.yPos - dist));\r\n    }\r\n    else{\r\n      \/\/don't edit the actual values yet because you need to\r\n      \/\/refernce them for other vertexes\r\n      Vertex p1Temp = new Vertex(p1.xPos,p4.yPos);\r\n      Vertex p2Temp = new Vertex(p1.xPos,p2.yPos);\r\n      Vertex p3Temp = new Vertex(p3.xPos,p2.yPos);\r\n      Vertex p4Temp = new Vertex(p3.xPos,p4.yPos);\r\n      \/\/now you can change the values\r\n      p1 = p1Temp;\r\n      p2 = p2Temp;\r\n      p3 = p3Temp;\r\n      p4 = p4Temp;\r\n    }\r\n  }\r\n}\r\n\r\nclass Vertex{\r\n  public int xPos;\r\n  public int yPos;\r\n  Vertex(int xP, int yP){\r\n    xPos = xP;\r\n    yPos = yP;\r\n  }\r\n}\r\n\r\nvoid mousePressed(){\r\n   setup();\r\n}\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this image I made a set of 4 roses bloom over time. This was somewhat tricky to get correct and involved a lot of playing around to figure out the best way to get it to look right. At &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/11\/nature-image-1-blooming-roses\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":12,"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\/444"}],"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\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=444"}],"version-history":[{"count":4,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/444\/revisions"}],"predecessor-version":[{"id":448,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/444\/revisions\/448"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}