cduong_Project-01-Face

sketch

function setup() {
    createCanvas(600, 600);
    background(255, 179, 179);

}

function draw(){

    //Hair
    noStroke();
    fill(0);
    rect(100, 160, 400, 480);

    //Ears
    noStroke();
    fill(255, 204, 153);
    ellipse(110,290,70,100);
    ellipse(490,290,70,100);

    //Clothes
    fill(209, 209, 224);
    rect(220, 480, 155, 300);

    fill(164, 164, 193);
    rect(260, 550, 5, 50);
    rect(330, 550, 5, 50);

    //Face + neck
    fill(255, 204, 153);
    arc(300, 480, 50, 50, 0, PI);
    rect(280, 450, 40, 30);
    ellipse(300,270,370,370);

    //Facial Expression
    fill(0);
    ellipse(200,240,45,10);
    ellipse(390,240,45,10);

    ellipse(200,295,90,60);
    ellipse(390,295,90,60);

    fill(256);
    ellipse(200,295,80,50);
    ellipse(390,295,80,50);

    fill(0);
    rect(370, 270, 40, 50);
    rect(180, 270, 40, 50);

    //Nose
    rect(290, 300, 5, 70);
    rect(300, 400, 20, 5);

    //Sleeves
    fill(209, 209, 224);
    rect(250, 480, 20, 30);
    rect(330, 480, 20, 30);

    //Side hair
    fill(0);
    rect(110, 220, 20, 200);
    rect(470, 220, 20, 200);

    //Glasses
    fill(77, 51, 0);
    rect(100, 250, 10, 80);
    rect(270, 250, 10, 80);
    rect(100, 250, 180, 10);
    rect(100, 330, 180, 10);

    rect(270, 280, 40, 10);

    rect(310, 250, 10, 80);
    rect(480, 250, 10, 80);
    rect(310, 250, 180, 10);
    rect(310, 330, 180, 10);

    //Bangs
    fill(0);
    translate(280/2, 130/2);
    rotate(1/2.1);
    ellipse(250, -50, 280, 130);

    translate(280/2, 130/2);
    rotate(-1/1.05);
    ellipse(10, -50, 280, 130);

    //sprout
    fill(0, 256, 0);
    translate(280/2, 130/2);
    rotate(1/2.1);
    ellipse(250, -50, 100, 60);

}

So I know some basic coding but I never really thought about how you could code shapes to make art so this was really interesting to try. I designed my self portrait on photoshop first and then tried to mimic what I drew using code.

Leave a Reply