{"id":19542,"date":"2018-01-15T21:57:25","date_gmt":"2018-01-16T02:57:25","guid":{"rendered":"http:\/\/blog.kenperlin.com\/?p=19542"},"modified":"2018-01-15T21:59:00","modified_gmt":"2018-01-16T02:59:00","slug":"cg-programming-for-non-programmers-lesson-13","status":"publish","type":"post","link":"http:\/\/blog.kenperlin.com\/?p=19542","title":{"rendered":"CG programming for non-programmers, lesson 13"},"content":{"rendered":"<p>One nice thing about defining functions is that you can call them more than once.<\/p>\n<p>In lesson thirteen we see an example of creating two disks, both calling the same function <code>disk(x,y,r)<\/code>, but with different arguments.<\/p>\n<p>One disk is red, and the other is green.  That&#8217;s because we use them to create the color:<\/p>\n<p>&nbsp; &nbsp; &nbsp; <code>vec3(c1, c2, 0.1)<\/code><\/p>\n<p>The red component of this color is <code>c1<\/code>, which has a high value only inside the first disk, the green component is <code>c2<\/code>, which has a high value only inside the second disk, and the blue component is <code>0.1<\/code>, which gives us a dark blue background everywhere.<\/p>\n<p>You can see this lesson by <a href=http:\/\/mrl.nyu.edu\/~perlin\/cg\/lesson13>CLICKING HERE<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One nice thing about defining functions is that you can call them more than once. In lesson thirteen we see an example of creating two disks, both calling the same function disk(x,y,r), but with different arguments. One disk is red, and the other is green. That&#8217;s because we use them to create the color: &nbsp; &hellip; <a href=\"http:\/\/blog.kenperlin.com\/?p=19542\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;CG programming for non-programmers, lesson 13&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/19542"}],"collection":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19542"}],"version-history":[{"count":4,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/19542\/revisions"}],"predecessor-version":[{"id":19546,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=\/wp\/v2\/posts\/19542\/revisions\/19546"}],"wp:attachment":[{"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19542"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.kenperlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}