Nayeon_project01_portrait

nayeon_portrait

//Na-yeon Kim
//15-104, B section
//nayeonk1@andrew.cmu.edu
//Project-01_Portrait


//Canvas
function setup() {
    createCanvas(600, 800);

  }

//background
function draw() {
    angleMode(DEGREES);
    background(20, 120,150); //light blue
    if (mouseX < (width / 2)){
          background(10, 50, 200); //blue
    }

//hair
    fill(0);
    ellipse((width / 2) + 80, (height / 2) - 50, 300, 300);
    push();
    rotate(30);
    ellipse((width / 2) + 50, 200, 200, 300);
    pop();
    ellipse(550, 400, 100, 100);

//face
    fill(220,180,150);
    noStroke();
    ellipse(width / 2, height / 2, 300, 400);
    ellipse((width / 2) - 20, (height / 2) + 78, 350, 250);

//ears
    ellipse(width / 2 + 170, (height / 2) + 50, 150, 150);

//hands
    push();
    rotate(-3);
    ellipse(100, 700, 150, 180);
    ellipse(180, 680, 50, 70);

    ellipse(400, 700, 150, 180);
    ellipse(320, 680, 50, 70);
    pop();

//eyes
    fill(40, 30, 20);
    noStroke();
    ellipse((width / 2) + 50, (height / 2), 30, 50);
    ellipse((width / 2) - 100, (height / 2), 30, 50);

//mouth
    fill(210, 115, 90);
    arc((width / 2) - 20, (height / 2) + 80, 150, 200, 0, 180, CHORD);

//teeth
    fill(265);
    arc((width / 2) - 20, (height / 2) + 80, 150, 50, 0, 180, CHORD);

//blush
    fill(225, 125, 100);
    ellipse((width / 2) + 100, (height / 2 + 50), 50, 50);
    ellipse((width / 2) - 150, (height / 2 + 50), 50, 50);
//front_hair
    push();
    rotate(-20);
    fill(0);
    ellipse((width / 2), (height / 2) + 20, 150, 200);
    pop();

//crown
    push();
    rotate(-5);
    fill(250, 180, 0);
    triangle(120, 130, 150, 280, 300, 280);
    triangle(220, 100, 200, 280, 350, 280);
    triangle(350, 100, 250, 280, 400, 280);
    triangle(450, 130, 300, 280, 450, 280);
    ellipse(300, 280, 300, 50);
    pop();

    fill(40, 180, 250);
    ellipse(125, 120, 50, 50);
    ellipse(230, 70, 50, 50);
    ellipse(360, 60, 50, 50);
    ellipse(460, 90, 50, 50);

//diamond
    fill(265)
    quad(mouseX, mouseY, mouseX +30, mouseY +50, mouseX, mouseY + 100 , mouseX -30, mouseY +50);



}

I struggled a lot to create drawing with code in the beginning since I’m too used to draw with my hand. When I tried to create shapes with code, my brain just couldn’t process in ‘programming’ way.
I even struggled to figure out x, y in script because it is apposite way to I’m used to think.
But after few hours with struggling, I started to enjoy this new way to draw something. It was actually very amusing struggle.

Leave a Reply