yoonyouk-project01-face


yoonyouk-project01-face

//Yoon Young Kim 
//Section E
//Yoonyouk@andrew.cmu.edu
//Project-01

function setup() {
    createCanvas(500, 500);
    background(255, 204, 204);
    angleMode(DEGREES);


    //background strip
    noStroke();
    fill(153, 204, 255);
    rect(0, 125, 600, 225);

    //shoulder
    noStroke();
    fill(255, 153, 153);
    ellipseMode(CENTER);
    arc(230, 500, 150, 325, 180, 0);


   //headshape
    noStroke();
    fill(255, 229, 204);
    ellipseMode(CENTER);
    ellipse(200, 250, 200, 210);
    

    //nose
    noStroke();
    fill(255, 229, 204);
    triangle(110, 230, 115, 300, 85, 300);

    //eye
    noStroke();
    fill(256);
    ellipseMode(CENTER);
    ellipse(135, 248, 25, 25);

    //pupil
    noStroke();
    fill(102, 51, 0);
    ellipseMode(CENTER);
    ellipse(128, 253, 10, 10);

    //hair
    noStroke();
    fill(153, 76, 0);
    ellipseMode(CENTER);
    arc(210, 235, 220, 230, 200, 60, PIE);

    //ponytail
    noStroke();
    fill(153, 76, 0);
    ellipseMode(CENTER);
    arc(320, 235, 100, 230, 195, 90, PIE);    

    //eyebrow
    stroke(153, 76, 0);
    strokeWeight(3);
    noFill();
    arc(135, 228, 40, 25, 270, 360);

    //smile
    stroke(255, 153, 153);
    strokeWeight(5);
    noFill();
    arc(127, 300, 50, 50, 15, 90);


    //glasses
    stroke(120);
    strokeWeight(6);
    noFill();
    ellipseMode(CENTER);
    ellipse(125, 250, 25, 40);


    stroke(120);
    strokeWeight(6);
    noFill();
    arc(138, 263, 190, 30, 270, 360);

    stroke(120);
    strokeWeight(6);
    noFill();
    arc(100, 250, 30, 13, 270, 360);

    //ear
    noStroke();
    fill(255, 204, 153);
    arc(220, 265, 30, 40, 250, 90, CHORD);




}

function draw() {
}

 

Cora Hickoff Self Portrait

Cora Self Portrait

//Cora Hickoff
//Section C 9:30AM-10:20AM
//chickoff@andrew.cmu.edu
//Project-01

function setup() {
    createCanvas(500,600);
    background(167,171,198);
}

function draw() {

    //face
    fill(255,255,255)
    noStroke(0)
    rect(175,120,160,240,50);

    //nose
    fill(247,216,180)
    noStroke(0)
    ellipse(225,250,15,40);

    //top of nose
    fill(255,255,255)
    noStroke(0)
    ellipse(225,237,15,40);

    //freckle blush
    fill(255,227,225)
    ellipse(230,230,60,20);

    //freckle 1
    fill(185,149,108)
    ellipse(215,230,4,4);

    //freckle 2
    fill(185,149,108)
    ellipse(230,225,3,3);

    //freckle 3
    fill(185,149,108)
    ellipse(240,234,3,3);

    //freckle 4
    fill(185,149,108)
    ellipse(250,234,4,4);

    //gold stripe 1
    fill(255,196,66)
    rect(220,360,70,20);

    //white stripe 1
    fill(255,255,255)
    rect(220,380,70,20);

    //gold stripe 2
    fill(255,196,66)
    rect(160,400,200,20,10);

    //white stripe 2
    fill(255,255,255)
    rect(140,415,235,20,10);

    //gold stripe 3
    fill(255,196,66)
    rect(135,435,245,20,10);

    //left gold sleeve stripe 1
    fill(255,196,66)
    rect(125,440,20,180,10);

    //left white sleeve stripe 1
    fill(255,255,255)
    rect(140,440,20,180,10);

    //left gold sleeve stripe 2
    fill(255,196,66)
    rect(160,440,20,180,10);

    //right gold sleeve stripe 1
    fill(255,196,66)
    rect(330,440,20,180,10);

    //right white sleeve stripe 1
    fill(255,255,255)
    rect(350,440,20,180,10);

    //right gold sleeve stripe 2
    fill(255,196,66)
    rect(370,440,20,180,10);

    //gold shirt square
    fill(255,173,10)
    rect(180,440,160,160);

    //mouth
    fill(0,0,0)
    ellipse(250,320,40,12);

    //tooth
    fill(255,255,255)
    noStroke(0)
    rect(241,313,6,7,1);

    //left eye
    fill(255,255,255)
    stroke(0)
    strokeWeight(2)
    translate(width/2,height/2)
    rotate(PI/4.0)
    ellipse(-136,-70,15,30);

    //right eye
    fill(255,255,255)
    stroke(0)
    strokeWeight(2)
    translate(width/150,height/8)
    rotate(HALF_PI/1.0)
    ellipse(-179,-2,15,20);

}

I started this project by first drawing a sketch of what I wanted to create. I then simplified it into the shapes that I’d program. Even though my original plans changed as once I started, I learned to adapt with the process and realize that it’s okay for things to go wrong. Sometimes the unexpected happens and the work is better than it would have been had everything gone to plan.

jknip-Project-01-Face

sketch.js

function setup() {
    createCanvas(600,600);
    //background(256,256,256);
    background(42,134,191);
}

function draw() {
	var a = color(253,233,53);  
	fill(a);  
	noStroke(); 
	rect(300, 0, 300, 600);
	var bc = color(31,50,101);  
	fill(bc);  
	noStroke(); 
	rect(160, 130, 285, 400, 140, 140, 15, 15);
	var c = color(243,197,192);  
	fill(c);  
	noStroke();  
	ellipse(300,300,250); 
	var cd = color(255,255,255);  
	fill(cd);  
	noStroke(); 
	arc(300, 300, 250, 250, -HALF_PI, HALF_PI, CHORD);
	noFill();
	var d = color(200,45,52);  
	stroke(d);
	strokeWeight(6);
	arc(260, 250, 50, 40, PI+QUARTER_PI, TWO_PI);
	arc(355, 250, 50, 40, PI+QUARTER_PI, TWO_PI);
	arc(300, 365, 30, 15, QUARTER_PI, PI+TWO_PI);
	noStroke();
	fill(d);  
	ellipse(250, 280, 20, 20);
	ellipse(345, 280, 20, 20);
	ellipse(290, 330, 10, 10);
	var e = color(163,144,129);
	stroke(e);  
	strokeWeight(3);
	line(365, 330, 375, 322);
	line(355, 330, 365, 322);
	line(345, 330, 355, 322);
	line(235, 330, 245, 322);
	line(225, 330, 235, 322);
	line(215, 330, 225, 322);
}

To develop this sketch, I played with a series of symmetrical components within the larger shapes that makes up the majority of the background. I wanted to create a more expressive, asymmetrical face within the smaller components of the face, using simple arcs, lines and circles.

elizabew-Project-01-Face

selfportrait

function setup(){
  createCanvas(400, 500); //width by height

}

function draw (){
  background(91,192,235); //RGB, 255 is black, 0 is white, 0,0,0,0 is transparent;

  //ellipse(200, 250, 200, 250); //x, y is position w, h is how large;

  noStroke(); //gets rid of default black line for the filled in shape
//hair
fill(49,50,66);
  rect(50, 140, 300, 500, 120, 120, 120, 120);
//neck
fill(223,192,155);
  rect(170, 400, 63, 105);
//ears
fill(246,226,198);
  ellipse(100, 320, 50, 55);
  ellipse(300, 320, 50, 55);
//head
fill(246,226,198); //filling rectangle color
  rect(100, 200, 200, 220, 60); //rect(upperleft, lowerright, radius of rounded corners)
fill(246,226,198);
  rect(200, 200, 100, 220, 0, 60, 60, 0);
//eyes
fill(255);
//arc(150, 300, 30, 30, 300, PI+QUARTER_PI, PIE); //x,y,w,h,angle to start, angle to stop
  ellipse(155, 300, 40, 40);
  ellipse(245, 300, 40, 40);
//eyeshine
fill(71,67,80);
  ellipse(160, 300, 30, 30);
  ellipse(250, 300, 30, 30);
//eyebrows
fill(71,67,80)
// Draw a rectangle with rounded corners having the following radii:
// top-left = 20, top-right = 15, bottom-right = 10, bottom-left = 5.
rect(120, 260, 55, 10, 80, 80, 80, 0);
rect(220, 260, 55, 10, 80, 80, 0, 80);
//bangs
fill(49,50,66);
rect(180, 180, 140, 90, 0, 180, 0, 180);
//cheeks
fill(244,96,54); //228,255,26
  ellipse(125, 350, 40, 40);
fill (244,96,54); //orange cheeks
  ellipse(275, 350, 40, 40);
    if (mouseX < (width / 2)) {
      fill (228,255,26); //yellow cheeks
      ellipse(125, 350, 40, 40);
      ellipse(275, 350, 40, 40);
    }
  //background(230, 230, 0); // Yellow
    //if (mouseX < (width / 2)) {
      //background(0, 0, 200); // Blue
//nose
fill(244,96,54);
  triangle(200, 300, 215, 350, 185, 350);
    if (mouseX < (width / 2)) {
      fill(0,114,255);
      triangle(200, 300, 215, 350, 185, 350);
    }
//mouth
fill(49,50,66);
  rect(165, 375, 70, 7);
//body
fill(253,231,76);
  rect(90, 445, 220, 95, 160, 160, 160, 160);
//hairshine
//fill(78,74,88);
  //ellipse(245, 225, 50, 50)

}

Reflection

Before I decided to take this class, the only class I ever took was a very basic C++ class back in high school. I still have limited knowledge of programming (since I forgot most of what I did learn), but I was eager about an opportunity to combine both programming and creativity; the latter of which I resonate with more often.

Before jumping right into making my portrait, I decided to sketch out my ideas on paper, using only basic shapes that I would be able to replicate using javascript.

This assignment was both frustrating and satisfying for me. Getting the hang of the graphing elements took longer than I would have liked, but I did enjoy the feeling of every new form appearing on the screen. It was like putting together a puzzle. Overall, it was a fun project that introduced me to the creative side of programming that I never really understood before.

Bettina-Project-01-Face

 

bettina-01-face

function setup() {
  createCanvas(325,611);
  background(246,201,69);
  
}

function draw() {
  fill(71,63,150); //hair 
  noStroke();
  ellipse(162,517,256);
  rect(34,444.5,256,256,75);
  stroke(71,63,150);
  strokeWeight(13);
  strokeCap(SQUARE);
  noFill();
  arc(180,375,90,90,HALF_PI+QUARTER_PI,PI+QUARTER_PI); //cowlick
  noStroke();
  fill(124,121,185);
  ellipse(188.5,432,88,53); //hair shine
  fill(239,204,188);
  rect(64,500,195,157,34.5); //skin base
  fill(239,171,146);
  rect(162,527.5,97.5,84.5) //skin shadow
  fill(71,63,150);
  quad(144.5,473,270.5,473,270.5,561.5,144.5,534); //bangs
  fill(244,134,107);
  rect(64,593,42,18); //blush
  rect(217.5,593,42,18);
  noFill();
  stroke(37,33,90);
  strokeWeight(6); //eyes and eyebrows
  arc(107,575,56,56,PI+QUARTER_PI,PI+HALF_PI+QUARTER_PI);
  strokeWeight(9);
  arc(107,592,45,45,PI+QUARTER_PI,PI+HALF_PI+QUARTER_PI);
  arc(218,592,45,45,PI+QUARTER_PI,PI+HALF_PI+QUARTER_PI);
}

Reflection

This assignment felt more straightforward than programming I’ve done in previous programming classes; instead of solving for a scenario we had the freedom to play with shapes to create an image. For artists and designers, this is satisfying because we like seeing visual output of our work and are taught that there is no set “right” or “wrong”.

Most of the time spent on creating this piece was preparation: sketching ideas of my portrait, mapping it out on Illustrator, and then math-ing out the coordinates necessary to create the shapes. The most complex math needed was remembering there’s 2 Pi in a circle to create arcs. Planning the drawing felt like building blocks: we had to be conscious of which basic shapes we’re piecing together to form a complex shape as well as which order to draw on top of the canvas.

Additional color iterations of my self-portrait

heyangc-project-01


function setup() {
    
    createCanvas(200, 200);
    background(220);
    ellipse(100,100,50,50);
    fill(100,100,30);
    rect(50,50,100,30);
}
    
function draw() {
	
}
	

heyangc-portrait-01

//Heyang Chen
//heyangc@andrew.cmu.edu
//Section D
//project-01 self-portrait


function setup() {

    createCanvas(840, 1060);

}


function draw() {

    background(247, 208, 223);
    stroke (0);
    strokeWeight (3.5);

    //hair-left
    noFill();
    beginShape();
    vertex(399, 82);
    bezierVertex(56, 122, 39, 558, 143, 633);
    endShape();

    noFill ();
    beginShape ();
    vertex (143, 633);
    bezierVertex (202, 701, 108, 768, 175, 872);
    endShape ();

    //hair-right
    noFill ();
    beginShape ();
    vertex (410, 85);
    bezierVertex (729, 178, 636, 501, 579, 628);
    endShape ();

    noFill ();
    beginShape ();
    vertex (579, 628);
    bezierVertex (525, 742, 560, 781, 587, 809);
    endShape ();

    noFill ();
    beginShape ();
    vertex (587, 809);
    bezierVertex (655, 844, 560, 891, 607, 915);
    bezierVertex (690, 966, 707, 875, 790, 913);
    bezierVertex (838, 935, 760, 1014, 825, 1036);
    endShape();

    //fringe-right
    strokeWeight (2)
    noFill ();
    beginShape ();
    vertex (412, 210);
    bezierVertex (583, 447, 503, 674, 463, 797);
    endShape ();

    //fringe-left
    noFill ();
    beginShape ();
    vertex (406, 210);
    bezierVertex (388, 412, 252, 362, 190, 479);
    endShape ();

    noFill ();
    beginShape ();
    vertex (190, 479);
    bezierVertex (177, 540, 167, 610, 226, 713);
    endShape ();

    //nose
    noFill ();
    beginShape ();
    vertex (362, 535);
    bezierVertex (390, 628, 334, 631, 375, 667);
    endShape ();

    //mouth
    noFill ();
    beginShape ();
    vertex (344, 732);
    bezierVertex (363, 747, 402, 743, 412, 727);
    endShape ();

    //face
    strokeWeight (3.5)
    noFill ();
    beginShape ();
    vertex (235, 711);
    bezierVertex (288, 783, 375, 875, 462, 760);
    endShape ();


    //neeck
    noFill ();
    beginShape ();
    vertex (433, 828);
    bezierVertex (405, 882, 403, 924, 426, 965);
    endShape ();

    //colar bone
    noFill ();
    beginShape ();
    vertex (410, 994);
    bezierVertex (429, 982, 453, 975, 477, 980);
    endShape ();

    noFill ();
    beginShape ();
    vertex (477, 980);
    bezierVertex (581, 992, 610, 955, 636, 970);
    endShape ();


    //circle
    fill (203, 32, 39);
    ellipse (255, 914, 180, 170);

    //curve
    noFill ();
    stroke (147, 26, 29);
    strokeWeight (5)
    beginShape ();
    vertex (387, 502);
    bezierVertex (419, 407, 463, 492, 567, 401);
    bezierVertex (603, 353, 548, 293, 560, 238);
    bezierVertex (575, 187, 683, 206, 798, 20);
    endShape ();

}

I made a drawing in illustrator first, then translated out. During the process, I found difficulties in making curves. first, I tried out the curvevertex syntax, but resulted in rather unsmooth curves. Then I tried to make the curves out of bezier curves. However, problems showed when making bezier curves out of more than 4 control points. After experimenting, I divided those curves into segments. Each of them consists of 4 control points.

Project-01-Face

sketch

//Natalie Schmidt
//Section D
//nkschmid@andrew.cmu.edu
//Project-01

function setup() { //background
    createCanvas(500, 500);
    background(256);
    angleMode(DEGREES);
}

function draw() {
//background design
    noStroke(0);
    fill(255, 186, 22);
    triangle(0, 0, width/2, 0, 0, height/2);
    fill(232, 17, 77);
    triangle(500, 0, width/2, 0, 500, height/2);
    fill(20, 179, 177);
    triangle(0, 500, 250, 500, 0, 250);
    fill(255, 132, 0);
    triangle(500, 500, 500, 250, 250, 500);
    fill(0);
  //hair
    fill(126, 45, 0);
    noStroke();
    ellipse(250, 285, 250 , 300);
//head shape
    fill(239, 189, 118);
    ellipse(250, 250, 200, 200);
//eyes
    fill(0);
    ellipse(220, 240, 25, 25);
    fill(0);
    ellipse(width-220, 240, 25, 25);
//eyelashes
    stroke(0);
    noFill();
    curve(185, 0, 205, 215, 220, 215, 220, 0);
    curve(width-185, 0, width-205, 215, width-220, 215, width-220, 0);
//nose
    fill(0);
    stroke(0);
    line(250, 235, 250, 260);
    stroke(0);
    line(250, 260, 265, 275);
    stroke(0);
    line(265, 275, 250, 280);
//freckles
    fill(167, 121, 55);
    noStroke();
    ellipse(200, 275, 3, 3);
    ellipse(180, 280, 3, 3);
    ellipse(170, 260, 3, 3);
    ellipse(190, 260, 3, 3);
    ellipse(215, 265, 3, 3);
    ellipse(230, 275, 3, 3);
    ellipse(width-200, 275, 3, 3);
    ellipse(width-180, 280, 3, 3);
    ellipse(width-170, 260, 3, 3);
    ellipse(width-190, 260, 3, 3);
    ellipse(width-215, 265, 3, 3);
    ellipse(width-225, 275, 3 ,3);
//mouth
    stroke(0);
    noFill();
    curve(210, 0, 210, 285, width-210, 285, 310, 0);
//bangs
    fill(126, 45, 0);
    noStroke();
    translate(495, 210);
    rotate(145);
    ellipse(220, 180, 150, 60);
}

While creating this project, I really just wanted to jump in head-first and try all kinds of different functions; however, having never coded before, this proved to be pretty difficult. I got the hang of ellipses, rectangles, color, etc., but I realized that many of the things I wanted to do were too advanced to attempt for now. Despite that, I’m very proud of what I created, seeing as how I had never done anything like this before. It was fun and incredibly satisfying to actually edit and type code and see that reflected on the image itself. I’m looking forward to learning more advanced material and learning how to incorporate more detail into future projects.

Project Week 1 – Self-Portrait

hyt-01

// helen tsui
// 15-104 section d
// hyt@andrew.cmu.edu
// project-01

function setup() {
    createCanvas(400, 400);
    background(60, 105, 128); 
}

function draw() {

stroke(200, 197, 209);
strokeWeight(8);

    fill(250, 225, 223); 
    arc(400, 80, 700, 600, QUARTER_PI, PI);
    ellipse(120, 130, 150, 150); //glasses
    ellipse(320, 130, 150, 150); //glasses
    line(210, 160, 230, 280); 
    line(230, 280, 270, 270); 
    curve(290, 300, 320, 328, 335, 330, 340, 348);
    noFill();
    //curve(0 , 80, 0, 200, 80, 300, 80, 400);
        

noStroke();

    fill(10, 10, 10); 
    arc(130, 140, 100, 40, PI, PI); //eyelid left
    arc(330, 140, 100, 40, PI, PI); //eyelid right

    fill(84, 106, 123);
    ellipse(130, 150, 45, 45); //eyeball left
    ellipse(330, 150, 45, 45); //eyeball right

}

For this project, I assorted a color palette for my self-portrait and used functions including curve, arc, fill, rect, strokes, etc. The process was difficult as I have never coded before, but the trial-and-error method eventually worked out well.

Christopher Reyes – Project-01 – Self-Portrait (Face)

Christopher Reyes Project-01

/*
Christopher Reyes
creyes1@andrew.cmu.edu
Section D
Project-01
*/

function setup() {

    createCanvas(600, 600); //Sets canvas size
    background(240); //Sets background color to light grey
    angleMode(DEGREES);
    strokeWeight(15);

}

function draw() {

    noStroke();

    //Draws a blue ellipse
    fill(121, 178, 178);
    ellipse(418, 192, 277, 269);

    //Draws a tan circle
    fill(206, 167, 133);
    ellipse(218, 340, 381, 381);

    //Draws a brown ellipse and rotates it 10 degrees
    fill(68, 49, 38);
    push();
    translate(320, 400);
    rotate(10);
    ellipse(0, 0, 280, 112);
    pop();

    //Draws several black shapes
    fill(0);
    ellipse(251, 295, 79, 84);
    ellipse(430, 295, 79, 84);
    rect(303, 401, 50, 31, 4, 4, 25, 25);

    stroke(0);
    strokeCap(ROUND);
    noFill();

    //Black ellipse "ear," no fill, rotated 344 degrees
    push();
    translate(142, 306);
    rotate(344);
    ellipse(0, 0, 60, 116);
    pop();

    //Draws a black arc, hairline
    arc(248, 254, 560, 102, 270, 0);

    //Black arcs for head shape, with rotations
    push();
    translate(420, 200);
    rotate(-11);
    arc(0, 0, 564, 242, -180, 270)
    pop();

    push();
    translate(421, 209);
    rotate(-11);
    arc(0, 0, 300, 260, 270, 0);
    pop();

    push();
    translate(461, 351.5);
    rotate(-343);
    arc(0, 0, 50, 250, 270, 80);
    pop();

    push();
    translate(208, 380);
    rotate(15);
    arc(0, 0, 500, 100, 0, 90);
    pop();

    push();
    translate(198, 394);
    rotate(9);
    arc(0, 0, 50, 68, 90, 180);
    pop();

    //Draws a pair of green glasses
    stroke(28, 91, 40);
    rect(172, 284, 160, 100, 12, 12, 37, 37);
    rect(377, 284, 160, 100, 12, 12, 37, 37);
    arc(360, 305, 90, 10, 190, 340);

}

For the sake of planning, I created a mock-up of what the image would look like using Adobe Illustrator, referencing that image in order to recreate it in JavaScript. However, I was not expecting the standard rotate(); command to rotate an object around the origin rather than the object’s center. To work around this, I utilized push(); and pop();, essentially rotating the canvas itself for a particular object to get it to appear in the desired orientation.

ENwandu-Project 01-Face

sketch

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

function draw() {
  //background
  background(175, 200, 135);

  //hair
  noStroke();
  fill(0);
  ellipse(297, 225, 374, 374);

  //face
  noStroke();
  fill(117, 77, 37);
  rect(150, 177, 290, 266);
  quad(150, 442, 440, 442, 354, 595, 240, 595);

  //nose
  noStroke();
  fill(110, 70, 40);
  quad(280, 450, 320, 450, 335, 470, 264, 470);
  fill(121, 79, 37);
  triangle(280, 450, 300, 330, 320, 450);

  //ears
  noStroke();
  fill(117, 77, 37);
  arc(140, 349, 55, 90, HALF_PI, HALF_PI);
  arc(450, 349, 55, 90, HALF_PI, HALF_PI);
  //inner ears
  fill(110, 70, 40)



  //glasses
  noFill();
  stroke(77, 77, 77);
  strokeWeight(15);
  rect(129, 301, 152, 91);
  rect(309, 301, 152, 91);
  line(281, 320, 309, 320);

  //eyes
  noStroke();
  fill(256);
  ellipse(219, 349, 75, 44);
  ellipse(372, 349, 75, 44);

  fill(0);
  ellipse(230, 355, 32, 32);
  ellipse(384, 355, 32, 32);

  //eyebrows
  noFill();
  stroke(0);
  strokeWeight(12);
  arc(230, 220, 195, 120, HALF_PI, PI-0.8);
  arc(384, 220, 195, 120, HALF_PI, PI-0.8);

  //mouth
  noStroke();
  fill(27);
  quad(235, 510, 365, 510, 325, 560, 275, 560);
  fill(290, 30, 121);
  arc(300, 560, 48, 34, PI, PI);


  }

The assignment wasn’t too difficult. I first abstracted a picture of myself into shapes in Illustrator, and used this as the foundation for constructing my code.