{"id":370,"date":"2018-09-10T21:30:05","date_gmt":"2018-09-10T21:30:05","guid":{"rendered":"https:\/\/www.courses.tegabrain.com\/cc18\/?page_id=370"},"modified":"2018-09-11T16:04:10","modified_gmt":"2018-09-11T16:04:10","slug":"2a-tues-9-11","status":"publish","type":"page","link":"https:\/\/www.courses.tegabrain.com\/cc18\/2a-tues-9-11\/","title":{"rendered":"2A Tues 9\/11"},"content":{"rendered":"<h3><strong>1. Reading:<\/strong><\/h3>\n<p><strong>I<\/strong>n the Daniel Shiffman, Learning Processing please read chapters 3. If you\u2019re book has not arrived yet, here is a <a href=\"https:\/\/www.courses.tegabrain.com\/CC17\/wp-content\/uploads\/2017\/09\/Chapter1-Learning_Processing_-_A_Beginners_Guide_to_Programming_Images_Animation_and_Interaction_-_Daniel_Shiffman.pdf\">soft copy of these chapters.<\/a><\/p>\n<h3><strong>2. Watch<\/strong><\/h3>\n<p>This talk by Zach Lieberman: <a href=\"https:\/\/www.youtube.com\/watch?v=bmztlO9_Wvo\">https:\/\/www.youtube.com\/watch?v=bmztlO9_Wvo<\/a><\/p>\n<h3><strong>3. Programming exercises:<br \/>\n<\/strong><\/h3>\n<ol class=\"ol1\">\n<li class=\"li1\">Complete exercise 3.3, 3.4 and 3.7 in Learning Processing.<\/li>\n<li>Pair programming exercises below<\/li>\n<li>Start thinking about <a href=\"https:\/\/www.courses.tegabrain.com\/cc18\/project-variable-face\/\">the Variable Face project (if time permits).<\/a><\/li>\n<\/ol>\n<p class=\"p1\">A) <em>Pair programming: Three Squares<\/em><\/p>\n<p class=\"p1\">This exercises will help you to learn variables.<\/p>\n<p><strong>The requirements are: <\/strong><\/p>\n<ul>\n<li>In a canvas of 600\u00d7300 (width x height) pixels,<\/li>\n<li>Declare a variable, which should be called <code>myUnit<\/code>, and assign it to have a value of 50.<\/li>\n<li>Draw a square, whose width and height are equal to that variable, <code>myUnit<\/code>.<\/li>\n<li>Draw another square, whose dimensions are exactly <em>twice<\/em> as large as the first square, and whose dimensions are defined in terms of <code>myUnit<\/code>s.<\/li>\n<li>Likewise, draw a third square, whose dimensions are exactly <em>three times<\/em> as large as the first square.<\/li>\n<li>These squares should be coded in such a way, that if the <code>myUnit<\/code> variable had instead been initialized with a different value (such as 60), all three squares would immediately assume new dimensions, while maintaining the same relative size proportions of 1:2:3.<\/li>\n<li>There are no requirements for the positioning (placement) of the squares \u2014 only their sizes.<\/li>\n<\/ul>\n<p>Then, as per usual add to the week 2, pair programming section of open processing.<\/p>\n<p>B) <em>Pair programming: Two Circles<\/em><\/p>\n<p>Here\u2019s an animated GIF showing a recording of a live interaction. Notice how the horizontal positions of the circles relate \u2014 in different ways \u2014 to the system property, <code>mouseX<\/code>:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-431\" src=\"https:\/\/i0.wp.com\/www.courses.tegabrain.com\/CC17\/wp-content\/uploads\/2017\/09\/balls.gif?resize=597%2C299&#038;ssl=1\" alt=\"\" width=\"597\" height=\"299\" \/><\/p>\n<p>Below is a <em>broken<\/em> version of the code which generated the above program. Go ahead, run it; you\u2019ll observe that the <code>fixme<\/code>variable, which controls the position of the black circle, ain\u2019t right. <strong>Your job is to correct the value assigned to <code>fixme<\/code>, in order to reproduce the behavior shown in the GIF above.<\/strong><\/p>\n<pre class=\"javascript\">void setup() {\r\n    size(600, 300);\r\n}\r\n \r\nvoid draw() {\r\n    background(170, 190, 200);\r\n    noStroke();\r\n \r\n    var fixme = random(width); \/\/ FIX ME!\r\n \r\n    fill(255);\r\n    ellipse(mouseX, 100, 60, 60);\r\n \r\n    fill(0);\r\n    ellipse(fixme, 200, 60, 60);\r\n}<\/pre>\n<p>Then, as per usual add to the week 2 section of open processing.<\/p>\n<p class=\"p1\"><strong>C) Extension exercise: <\/strong><b>Eyes Following Mouse<\/b><\/p>\n<p class=\"p1\">Draw a set of eyes with pupils that follow the mouse. Constrain each pupil to stay within its eyeball. You may need one of the following functions:<\/p>\n<p><a href=\"https:\/\/processing.org\/reference\/map_.html\">https:\/\/processing.org\/reference\/map_.html <\/a><\/p>\n<p class=\"p4\"><a href=\"https:\/\/processing.org\/reference\/constrain_.html\">https:\/\/processing.org\/reference\/constrain_.html<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Reading: In the Daniel Shiffman, Learning Processing please read chapters 3. If you\u2019re book has not arrived yet, here is a soft copy of these chapters. 2. Watch This talk by Zach Lieberman: https:\/\/www.youtube.com\/watch?v=bmztlO9_Wvo 3. Programming exercises: Complete exercise 3.3, 3.4 and 3.7 in Learning Processing. Pair programming exercises below Start thinking about the<a class=\"more-link button\" href=\"https:\/\/www.courses.tegabrain.com\/cc18\/2a-tues-9-11\/\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-370","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/Paeb9f-5Y","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/pages\/370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/comments?post=370"}],"version-history":[{"count":5,"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/pages\/370\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/pages\/370\/revisions\/387"}],"wp:attachment":[{"href":"https:\/\/www.courses.tegabrain.com\/cc18\/wp-json\/wp\/v2\/media?parent=370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}