{"id":202,"date":"2015-06-18T06:18:02","date_gmt":"2015-06-18T02:18:02","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=202"},"modified":"2015-06-18T19:11:38","modified_gmt":"2015-06-18T15:11:38","slug":"exercise-41","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/exercise-41\/","title":{"rendered":"Exercise 41"},"content":{"rendered":"<pre><code>\r\nint frames = 220, num=30;\r\nfloat theta;\r\n \r\nvoid setup() {\r\n  size(750, 750);\r\n}\r\n \r\nvoid draw() {\r\n  background(20);\r\n  stroke(#9EC3CE, 255);\r\n  strokeWeight(2);\r\n  noFill();\r\n  translate(width\/2, height\/2);\r\n  for (int i=0; i < num; i++) {\r\n    pushMatrix();\r\n    float offSet=TWO_PI\/num*i;\r\n    rotate(offSet);\r\n    float sz = map(sin(theta),-1,1,width*.15,width*.2);\r\n    float x = map(sin(theta), -1, 1, sz, width*.2);\r\n    translate(x, 0);\r\n    pushMatrix();\r\n    rotate(theta);\r\n    if (i%2==0) {\r\n      ellipse(0, 0, sz, sz*2);\r\n    } else {\r\n      ellipse(0, 0, sz*.7, sz*2*.7);\r\n    }\r\n    popMatrix();\r\n    popMatrix();\r\n  }\r\n  theta += TWO_PI\/frames;\r\n  \/\/if (frameCount<=frames) saveFrame(\"image-###.gif\");\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>int frames = 220, num=30; float theta; void setup() { size(750, 750); } void draw() { background(20); stroke(#9EC3CE, 255); strokeWeight(2); noFill(); translate(width\/2, height\/2); for (int i=0; i < num; i++) { pushMatrix(); float offSet=TWO_PI\/num*i; rotate(offSet); float sz = map(sin(theta),-1,1,width*.15,width*.2); float x = map(sin(theta), -1, 1, sz, width*.2); translate(x, 0); pushMatrix(); rotate(theta); if (i%2==0) { ellipse(0, [&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":[3],"tags":[],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-lessons"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/202","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=202"}],"version-history":[{"count":2,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":216,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/202\/revisions\/216"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}