{"id":208,"date":"2015-06-18T06:25:46","date_gmt":"2015-06-18T02:25:46","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=208"},"modified":"2015-06-18T18:50:38","modified_gmt":"2015-06-18T14:50:38","slug":"exercise-44","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/exercise-44\/","title":{"rendered":"Exercise 44"},"content":{"rendered":"<pre><code>\r\nint num=10, sw=8, fc;\r\nfloat r;\r\nlong rs;\r\nboolean save = false;\r\n \r\nvoid setup() {\r\n  size(500, 500);\r\n  \/\/colorMode(HSB, 360, 100, 100);\r\n  noFill();\r\n  rs = (long) random(100);\r\n  strokeWeight(sw);\r\n  strokeCap(SQUARE);\r\n}\r\n \r\nvoid draw() {\r\n  randomSeed(rs);\r\n  background(#14133B);\r\n  for (int i=0; i < 3; i++) {\r\n    arcs(width\/2, height\/2);\r\n  }\r\n  if (save) {\r\n    if (frameCount%2==0 &#038;&#038; frameCount < fc+241) saveFrame(\"frames\/image-###.png\");\r\n  }\r\n}\r\n \r\nvoid arcs(float x, float y) {\r\n  pushMatrix();\r\n  translate(x, y);\r\n  rotate(r);\r\n  for (int i=0; i < num; i++) {\r\n    \/\/stroke(360.0\/num*i, 100, 100, 120);\r\n    float lerpAmount = 1.0\/num*i;\r\n    color col = lerpColor(#9E023B, #FFC675, lerpAmount);\r\n    stroke(col, 220);\r\n    float start = random(TWO_PI);\r\n    float end = start + random(PI\/5, PI\/3);\r\n    float scal = map(sin(r+TWO_PI\/num*i), -1, 1, .5, 1.5);\r\n    arc(0, 0, width*.7-i*4*sw, height*.7-i*4*sw, start, end*scal);\r\n  }\r\n  r += .0523\/2;\r\n  popMatrix();\r\n}\r\n \r\nvoid keyPressed() {\r\n  save = true;\r\n  fc = frameCount;\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>int num=10, sw=8, fc; float r; long rs; boolean save = false; void setup() { size(500, 500); \/\/colorMode(HSB, 360, 100, 100); noFill(); rs = (long) random(100); strokeWeight(sw); strokeCap(SQUARE); } void draw() { randomSeed(rs); background(#14133B); for (int i=0; i < 3; i++) { arcs(width\/2, height\/2); } if (save) { if (frameCount%2==0 &#038;&#038; frameCount < fc+241) saveFrame(\"frames\/image-###.png\"); [&hellip;]\n<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-208","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/comments?post=208"}],"version-history":[{"count":2,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/208\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/208\/revisions\/214"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}