{"id":269,"date":"2015-06-23T17:23:42","date_gmt":"2015-06-23T13:23:42","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=269"},"modified":"2015-06-23T17:24:20","modified_gmt":"2015-06-23T13:24:20","slug":"bonus-waves","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/bonus-waves\/","title":{"rendered":"Bonus: Waves"},"content":{"rendered":"<pre><code>\r\nint i, w=1024, h=768, x, y, s=10;\r\nfloat k, m, r, j=.01;\r\n\r\nvoid setup() {\r\n  size(w, h, P3D);\r\n  noStroke();\r\n}\r\n\r\nvoid draw()\r\n{\r\n  background(#A4D6E8);\r\n  lights();\r\n  beginShape(8);\r\n  for (i=0; i < w*h; i+=s)\r\n  {\r\n    x=i%w;\r\n    y=i\/w;     \r\n    k=y+s;\r\n    m=x+s;\r\n    fill(100, 100, random(220,255), 200);\r\n    vertex(x, n(y*w+x), y);\r\n    vertex(m, n(y*w+m), y);\r\n    vertex(m, n(k*w+m), k);\r\n    vertex(m, n(k*w+m), k);\r\n    vertex(x, n(k*w+x), k);\r\n    vertex(x, n(y*w+x), y);\r\n    i+=i%w==0?w*(s-1):0;\r\n  }\r\n  endShape();\r\n  r-=j;\r\n    fill(100, 100, random(220,255), 200);\r\n  rect(0, width* .5, width, 400);\r\n}\r\nfloat n(float i) {\r\n  return noise(i%w*j, i*j\/w+r)*s*8+h\/2;\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>int i, w=1024, h=768, x, y, s=10; float k, m, r, j=.01; void setup() { size(w, h, P3D); noStroke(); } void draw() { background(#A4D6E8); lights(); beginShape(8); for (i=0; i < w*h; i+=s) { x=i%w; y=i\/w; k=y+s; m=x+s; fill(100, 100, random(220,255), 200); vertex(x, n(y*w+x), y); vertex(m, n(y*w+m), y); vertex(m, n(k*w+m), k); vertex(m, n(k*w+m), k); vertex(x, n(k*w+x), [&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-269","post","type-post","status-publish","format-standard","hentry","category-lessons"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/269","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=269"}],"version-history":[{"count":2,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":271,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/269\/revisions\/271"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}