{"id":73878,"date":"2022-10-08T13:56:56","date_gmt":"2022-10-08T17:56:56","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73878"},"modified":"2022-10-08T13:56:56","modified_gmt":"2022-10-08T17:56:56","slug":"project-06-2","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/08\/project-06-2\/","title":{"rendered":"Project 06"},"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>sleeping earth, suns, moons, and stars!<\/p>\n<div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/sketch-62.js\" data-width=\"480\" data-height=\"480\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/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\">\/\/ Sowang Kundeling skundeli Section C Project 05\n\nvar angle = 0;\nvar x = 480\/2;\nvar y = 480;\nvar z = 60; \/\/ size\n\nfunction setup() {\n    createCanvas(480, 480);\n}\n\nfunction draw() {\n    background('black');\n    push();\n    frameRate(1);\n    translate(240, 480);\n    rotate(radians(7) * second());\n    galaxy();\n    pop();\n  \n    noStroke();\n    fill('black')\n    var eyeLX = x + 60\n    var eyeRX = x - 60\n    ellipse(eyeLX, y-60, z+10, z); \/\/ left eye\n    ellipse(eyeRX, y-60, z+10, z); \/\/ right eye\n    fill(9, 130, 13);\n    ellipse(eyeLX, y-75, z+15, z); \/\/ cut out left eye\n    ellipse(eyeRX, y-75, z+15, z) \/\/ cut out right eye\n  \n    push();\n    frameRate(1);\n    translate(x-120, y-350);\n    rotate(radians(5) * second());\n    star(0+minute(), 0+minute(), 10, 30, 5); \/\/ left star\n    pop();\n  \n    push();\n    frameRate(1);\n    translate(x+120, y-380);\n    rotate(-radians(5) * second());\n    star(0+minute(), 0+minute(), 5, 20, 5); \/\/ right star\n    pop();\n}\n\nfunction galaxy() {\n    \/\/ earth\n    translate(-240, -480);\n    fill(9, 130, 13); \/\/ green\n    noStroke();\n    circle(x, y, z*5);\n  \n    \/\/ yellow\n    noStroke();\n    fill(245, 206, 51); \/\/ yellow\n    circle(x, y-200, z);\n    fill(242, 221, 136); \/\/ inner yellow\n    circle(x, y-200, z\/2)\n  \n    \/\/ orange\n    fill(245, 145, 51); \/\/ orange\n    circle(x+200, y, z);\n    fill(242, 188, 138); \/\/ inner orange\n    circle(x+200, y, z\/2);\n  \n    \/\/ dark blue\n    fill(74, 51, 245); \/\/ dark blue\n    circle(x, y+200, z);\n    fill(167, 156, 247); \/\/ inner dark blue\n    circle(x, y+200, z\/2);\n\n    \/\/ light blue\n    fill(150, 198, 250); \/\/ light blue\n    circle(x-200, y, z);\n    fill(211, 227, 245); \/\/ inner light blue\n    circle(x-200, y, z\/2)\n\n}\n\nfunction star(x, y, radius1, radius2, npoints) { \/\/ reference star https:\/\/editor.p5js.org\/p5\/sketches\/Form:_Star\n    fill(241, 242, 153)\n    let angle = TWO_PI \/ npoints;\n    let halfAngle = angle \/ 2.0;\n    beginShape();\n    for (let a = 0; a &lt; TWO_PI; a += angle) {\n      let sx = x + cos(a) * radius2;\n      let sy = y + sin(a) * radius2;\n      vertex(sx, sy);\n      sx = x + cos(a + halfAngle) * radius1;\n      sy = y + sin(a + halfAngle) * radius1;\n      vertex(sx, sy);\n    }\n    endShape(CLOSE);\n}<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sleeping earth, suns, moons, and stars! sketch \/\/ Sowang Kundeling skundeli Section C Project 05 var angle = 0; var x = 480\/2; var y = 480; var z = 60; \/\/ size function setup() { createCanvas(480, 480); } function draw() { background(&#8216;black&#8217;); push(); frameRate(1); translate(240, 480); rotate(radians(7) * second()); galaxy(); pop(); noStroke(); fill(&#8216;black&#8217;) var &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/08\/project-06-2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 06&#8221;<\/span><\/a><\/p>\n","protected":false},"author":731,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[106,57],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73878"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/731"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73878"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73878\/revisions"}],"predecessor-version":[{"id":73879,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73878\/revisions\/73879"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}