sketch-125.js
//Crystal Xue
//15104-section B
//luyaox@andrew.cmu.edu
//Assignment-01
function setup() {
createCanvas(600,600);
background(221,210,59);
angleMode(DEGREES);
}
function draw() {
noStroke();
fill(220,184,121);
ellipse(300,270,233,280);
//face
fill(155,145,194);
rect(205,430,190,140);
triangle(205,430,205,530,160,510);
triangle(395,430,395,530,440,510);
//shirt
fill(220,184,121);
rect(270,380,60,60);
rect(235,430,130,80);
//neck
fill(255,255,255);
circle(300,490,10);
circle(290,488,6);
circle(280,485,6);
circle(270,478,6);
circle(260,468,6);
circle(251,454,6);
circle(245,435,6);
circle(355,435,6);
circle(349,454,6);
circle(340,468,6);
circle(330,478,6);
circle(320,485,6);
circle(310,488,6);
//necklace
fill(255,255,255);
ellipse(250,273,33,20);
ellipse(350,273,33,20);
fill(0);
circle(250,270,25);
circle(350,270,25);
stroke(20);
strokeWeight(4);
line(265,263,200,260);
line(260,263,217,266);
line(333,263,394,260);
line(337,263,382,266);
//eyes
fill(0);
beginShape();
curveVertex(350, 140);
curveVertex(300, 220);
curveVertex(220, 250);
curveVertex(200, 320);
curveVertex(200, 380);
curveVertex(190, 420);
curveVertex(160, 420);
curveVertex(160, 330);
curveVertex(160, 220);
curveVertex(260, 130);
curveVertex(350, 140);
curveVertex(300, 220);
curveVertex(220, 250);
endShape();
fill(0);
beginShape();
curveVertex(320, 80);
curveVertex(350, 140);
curveVertex(380, 190);
curveVertex(420, 250);
curveVertex(420, 270);
curveVertex(415, 250);
curveVertex(370, 200);
curveVertex(350, 150);
curveVertex(320, 80);
endShape();
fill(0);
beginShape();
curveVertex(160, 400);
curveVertex(140, 450);
curveVertex(160, 490);
curveVertex(180, 440);
curveVertex(190, 410);
curveVertex(150, 400);
endShape();
push();
rotate(50);
fill(0);
ellipse(400,-175,140,30);
pop();
//hair
noStroke();
fill(119,66,141);
circle(169,430,20);
triangle(160,430,120,410,120,440);
triangle(180,430,210,410,210,440);
//hairtie
fill(220,184,121);
ellipse(426,265,27,45);
//ears
fill(152,109,178);
ellipse(210,310,100,20);
ellipse(390,310,100,20);
//blush
fill(168,73,122);
circle(300,370,30);
fill(98,41,84);
circle(300,375,20);
//mouth
}
This was my very first time trying to generate images by coding. It was quite a fun and self-reflecting experience. Especially when I was generating curves, it reminds me of the blind drawing exercise(Drawing only looking at the subjects but not the canvas) I’ve done in high school.