Siwei Xie-Project-01-Face

sketch

//Siwei Xie
//Section 1-B
//sxie1@andrew.cmu.edu
//Project-01-self portrait

function setup() {
    createCanvas(500,500);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
	//hair
	fill(0);
	rect(115,120,270,300);

	//clothes
	fill(122,35,76);
	noStroke();
	quad(150, 391, 345, 390, 450, 500,100, 500);

	//face
	fill(232,196,131);
	noStroke();
	ellipse(250,250,250,300);

	//left eye
	fill(3,3,3);
	ellipse(200,250,40,20);

	//right eye
	fill(3,3,3);
	ellipse(300,250,40,20);

	//nose
	fill(179,149,85);
	triangle(250,260,240,300,260,300);

	//mouth
	fill(208,68,61);
	ellipse(250,345,35,15);

	//eyebrow
	stroke(0);
    push();
    strokeWeight(5)
    line(180, 230, 215, 230);
    line(320, 230, 280, 230);
    pop();

	// left eye white
	fill(255)
	noStroke();
	square(195, 245, 8);

	// right eye white
	fill(255)
	noStroke();
	square(295, 245, 8);

	// right earring
	fill(128,194,233);
	arc(370, 300, 60, 60, 15, HALF_PI);

	// left earring
	fill(128,194,233);
	arc(120, 300, 60, 60, 15, HALF_PI);

	//hat
	fill(0,0,196);
	ellipse(250,135,285,125);

	
}

I think my sketch captures my facial features. Although I don’t have an artistic background, it was fun to add accessories such as hat & earrings to my portrait.

Leave a Reply