{"id":67767,"date":"2021-10-16T20:53:29","date_gmt":"2021-10-17T00:53:29","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=67767"},"modified":"2021-10-16T20:53:29","modified_gmt":"2021-10-17T00:53:29","slug":"project-7-curves","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/16\/project-7-curves\/","title":{"rendered":"Project 7: Curves"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div class=\"wp-block-file\"><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/wpf-curves.js\" data-width=\"480\" data-height=\"480\">wpf-curves.js<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"480\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Patrick Fisher, Section B, wpf@andrew.cmu.edu Assignment -07-project\nvar functionState = 1;\nfunction setup() {\n    createCanvas(480, 480);\n    frameRate(10);\n}\n\nfunction draw() {\n    var nPoints = 80;\n    var radius = 150;\n    var separation = 120;\n\n    if(functionState == 1){ \/\/glitchy circle\n        background(0);\n        fill(255, 255, 255, 64);\n        var mouseXincrease = map(mouseX,0,width,-40,40);\n        var mouseYincrease = map(mouseY,0,height,-40,40);\n        var colorXY = map(mouseX + mouseY,0,960,0,255);\n    \n        push();\n    \n        translate(2*separation, height \/ 2);\n        fill(255,0,colorXY);\n        beginShape();\n        for (var i = 0; i &lt; nPoints; i++) {\n            var theta = map(i, 0, nPoints, 0, TWO_PI);\n            var px = radius * cos(theta);\n            var py = radius * sin(theta);\n            vertex(px + random(-40, mouseXincrease), py + random(-40, mouseYincrease));\n        }\n        endShape(CLOSE);\n        pop();\n    } \n\n    else if(functionState == 2) {\n        var mouseXpoints = map(mouseX,0,width\/2,1,30);\n        var oppoY = map(mouseY,0,width,255,0);\n\n        background(240);\n        push();\n        fill(oppoY)\n        translate(2*separation, height \/ 2);\n        beginShape();\n        for (var i = 0; i &lt; mouseXpoints; i++) {\n            var theta = map(i, 0, mouseXpoints, 0, TWO_PI);\n            var px = radius * cos(theta);\n            var py = radius * sin(theta);\n            vertex(px,py); \n            ellipse(px, py, 3,3);\n        }\n        endShape(CLOSE);\n        pop();\n    }    \n}\n\nfunction mousePressed(){\n    if(functionState ==1){\n        functionState = 2;\n    } else if(functionState ==2){\n        functionState = 1;\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<p>I am very conflicted on the result of this project. I had a major lack of inspiration when it came to ideas, so I ended up taking some of the shapes shown in the sample and playing around a bit with them. I had difficulty with some of my map functions as they were not working as I had intended for some reason. However, I do like in the end what I came up with. The circle getting more and more glitchy is really fun and I really love how the vertices of the second circle spring out of the original one like a clown car.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"966\" height=\"945\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.06-PM.png\" alt=\"\" class=\"wp-image-67769\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.06-PM.png 966w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.06-PM-300x293.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.06-PM-768x751.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"958\" height=\"957\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.13-PM.png\" alt=\"\" class=\"wp-image-67770\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.13-PM.png 958w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.13-PM-300x300.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.13-PM-150x150.png 150w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.13-PM-768x767.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"961\" height=\"953\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.19-PM.png\" alt=\"\" class=\"wp-image-67771\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.19-PM.png 961w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.19-PM-300x298.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.19-PM-150x150.png 150w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.19-PM-768x762.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"961\" height=\"962\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.25-PM.png\" alt=\"\" class=\"wp-image-67772\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.25-PM.png 961w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.25-PM-300x300.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.25-PM-150x150.png 150w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-16-at-8.32.25-PM-768x769.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>wpf-curves.js \/\/Patrick Fisher, Section B, wpf@andrew.cmu.edu Assignment -07-project var functionState = 1; function setup() { createCanvas(480, 480); frameRate(10); } function draw() { var nPoints = 80; var radius = 150; var separation = 120; if(functionState == 1){ \/\/glitchy circle background(0); fill(255, 255, 255, 64); var mouseXincrease = map(mouseX,0,width,-40,40); var mouseYincrease = map(mouseY,0,height,-40,40); var colorXY = &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/16\/project-7-curves\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 7: Curves&#8221;<\/span><\/a><\/p>\n","protected":false},"author":648,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[108,56],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67767"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/users\/648"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=67767"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67767\/revisions"}],"predecessor-version":[{"id":67773,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67767\/revisions\/67773"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=67767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=67767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=67767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}