{"id":68429,"date":"2021-10-31T19:12:28","date_gmt":"2021-10-31T23:12:28","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=68429"},"modified":"2021-10-31T19:12:54","modified_gmt":"2021-10-31T23:12:54","slug":"project-9-computational-portrait-3","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/31\/project-9-computational-portrait-3\/","title":{"rendered":"Project 9: Computational portrait"},"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\"><p><a class=\"p5_sketch_link\" data-width=\"310\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-150.js\">sketch<\/a><a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-150.js\" class=\"wp-block-file__button\" download>Download<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"310\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ Yash Mittal\n\/\/ Section D\n\nfunction preload(){\n    Pimg = loadImage (\"https:\/\/i.imgur.com\/PLF0Wbf.jpg\"); \/\/ load image\n}\n\nfunction setup () {\n    createCanvas (310, 480);  \n    frameRate (100000000000000);\n    background (0);\n    Pimg.resize (310, 480);\n}\n\nfunction draw () {\n\n    var a = random (width);\n    var b = random (height);\n    var pixela = constrain (floor (a), 0, width - 1);\n    var pixelb = constrain (floor (b), 0, height - 1);\n    var sw = random (0, 0.5); \/\/ randomising stroke weight\n    var pixelColorLocationXY = Pimg.get (pixela, pixelb);\n\n    strokeWeight (sw); \/\/ randomised stroke weight\n    fill (pixelColorLocationXY);\n\n    beginShape (); \/\/ making a new hexagonal shape\n    vertex (a, b);\n    vertex (a + 4, b);\n    vertex (a + 7, b + 4);\n    vertex (a + 5, b + 8);\n    vertex (a, b + 8);\n    vertex (a - 2, b + 4);\n    endShape (CLOSE);\n\n}\n\n\n<\/code><\/pre><\/p><\/div>\n\n\n\n<p>For this project, I wanted to develop a somewhat abstract self portrait that is made of hexagonal shapes that appear on screen in a linear fashion. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketchDownload \/\/ Yash Mittal \/\/ Section D function preload(){ Pimg = loadImage (&#8220;https:\/\/i.imgur.com\/PLF0Wbf.jpg&#8221;); \/\/ load image } function setup () { createCanvas (310, 480); frameRate (100000000000000); background (0); Pimg.resize (310, 480); } function draw () { var a = random (width); var b = random (height); var pixela = constrain (floor (a), 0, width &#8211; &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/31\/project-9-computational-portrait-3\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 9: Computational portrait&#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":[111,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68429"}],"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=68429"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68429\/revisions"}],"predecessor-version":[{"id":68432,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68429\/revisions\/68432"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=68429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=68429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=68429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}