{"id":206,"date":"2015-06-18T06:21:25","date_gmt":"2015-06-18T02:21:25","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=206"},"modified":"2015-06-18T18:51:28","modified_gmt":"2015-06-18T14:51:28","slug":"exercise-43","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/exercise-43\/","title":{"rendered":"Exercise 43"},"content":{"rendered":"<pre><code>int num=50, d=100, frames=120;\r\nfloat theta;\r\n\r\nvoid setup() {\r\n  size(540, 540, P2D);\r\n  blendMode(SCREEN);\r\n  stroke(255);\r\n  noStroke();\r\n  fill(255);\r\n  \/\/noFill();\r\n}\r\n\r\nvoid draw() {\r\n  background(0);\r\n  for (int j=0; j < 3; j++) {\r\n    if (j==0) fill(255, 0, 0);\r\n    if (j==1) fill(0, 255, 0);\r\n    if (j==2) fill(0, 0, 255);\r\n    for (int i=0; i < num; i++) {\r\n      float angle = TWO_PI\/num*i;\r\n      float x = width\/2 + j*5 + cos(angle)*d;\r\n      float y = height\/2 + sin(angle)*d;\r\n      pushMatrix();\r\n      translate(x, y);\r\n      rotate(theta+angle);\r\n      float d2=d*1.5;\r\n      arc(0, 0, d2, d2, 0, radians(5));\r\n      popMatrix();\r\n    }\r\n  }\r\n  theta += TWO_PI\/frames;\r\n  \/\/ if (frameCount <= frames) saveFrame(\"frames\/image-###.png\");\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>int num=50, d=100, frames=120; float theta; void setup() { size(540, 540, P2D); blendMode(SCREEN); stroke(255); noStroke(); fill(255); \/\/noFill(); } void draw() { background(0); for (int j=0; j < 3; j++) { if (j==0) fill(255, 0, 0); if (j==1) fill(0, 255, 0); if (j==2) fill(0, 0, 255); for (int i=0; i < num; i++) { float angle [&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-206","post","type-post","status-publish","format-standard","hentry","category-lessons"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/206","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=206"}],"version-history":[{"count":2,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/206\/revisions"}],"predecessor-version":[{"id":215,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/206\/revisions\/215"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}