{"id":67780,"date":"2021-10-16T21:16:53","date_gmt":"2021-10-17T01:16:53","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=67780"},"modified":"2021-10-16T21:23:26","modified_gmt":"2021-10-17T01:23:26","slug":"project-7-composition-with-curves-3","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/16\/project-7-composition-with-curves-3\/","title":{"rendered":"Project 7: Composition with 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><p><a class=\"p5_sketch_link\" data-width=\"480\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-107.js\">sketch<\/a><a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-107.js\" download><\/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\">\/\/ Yash Mittal\n\/\/ Section D\n\nnPoints = 100;\n\nfunction setup() {\n    createCanvas(480, 480);\n    frameRate (7);\n}\n\n\nfunction drawLemniscateCurve () { \/\/ coding the curve\n\n    var x;\n    var y;\n\n    var a = 180;\n    var h = mouseX; \/\/ X axis interaction\n    var w = map (mouseY, 0, 480, 0, 240) \/\/ Y axis interaction\n\n    stroke (205, 0, 11);\n    strokeWeight (5);\n    fill (255);\n\n    beginShape ();\n\n    for (var i = 0; i &lt; nPoints; i = i + 1) {\n\n        var t = map (i, 0, nPoints, 0, TWO_PI);\n\n        x = (a * cos (t + w)) \/ (1 + pow(sin (t), 2)); \/\/ iterating x\n        y = (a * sin (t + h)) * (cos (t)) \/ (1 + pow(sin (t), 2)); \/\/ iterating y\n\n        vertex (x + w \/ 3, y + h \/ 3);\n    }\n\n    endShape (CLOSE);\n}\n\nfunction draw() { \n\n    background (0);\n\n    push ();\n    translate (width \/ 2, height \/ 2);\n    drawLemniscateCurve ();\n\n\n    }\n\n<\/code><\/pre><\/p>\n\n\n\n<p>After I chose my curve, I realized that it somewhat looks like Spiderman&rsquo;s eyes from into the spider-verse and I wanted to experiment more with that so I tried to iterate different eyes based on the X and Y location of the mouse. I struggled with drawing the curve at first but once I understood the concept, iterating became pretty easy.<\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch \/\/ Yash Mittal \/\/ Section D nPoints = 100; function setup() { createCanvas(480, 480); frameRate (7); } function drawLemniscateCurve () { \/\/ coding the curve var x; var y; var a = 180; var h = mouseX; \/\/ X axis interaction var w = map (mouseY, 0, 480, 0, 240) \/\/ Y axis interaction &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/16\/project-7-composition-with-curves-3\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 7: Composition with curves&#8221;<\/span><\/a><\/p>\n","protected":false},"author":661,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[108,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67780"}],"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\/661"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=67780"}],"version-history":[{"count":6,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67780\/revisions"}],"predecessor-version":[{"id":67797,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67780\/revisions\/67797"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=67780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=67780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=67780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}