egrady-project02-variableface

sketch

//Ean Grady
//Section B
//egrady@andrew.cmu.edu
//project-02

var mouth = 25;
var nose = 250;
var eyes = 25;
var eyes2 = 25;
var faceHeight = 150;
var faceWidth = 400;
var x = 0
var y = 0
var z = 0
var x2 = 0
var y2 = 0
var z2 = 0

function setup() {
    createCanvas(640, 480);
}

function draw() {
    background (120, 200, 400);

    //hair
    fill (x, y, z)
    triangle(250, 190, 225, 190, 220, 120)
    triangle(250, 192, 275, 190, 260, 100)
    triangle(275, 190, 300, 190, 300, 120)

    //face
    fill (255, 255, 255)
    stroke (0, 0, 0)
    ellipse (300, 225, faceWidth, faceHeight)

    //eyes
    fill (255, 255, 255)
    stroke (0, 0, 0)
    ellipse (170, 220, eyes*4, eyes*2)
    ellipse (420, 220, eyes*4, eyes*2)
    fill (x2, y, z)
    ellipse (170, 220, eyes2, eyes)
    ellipse (420, 220, eyes2, eyes)

    //nose
    line (nose, 180, 330, 240)
    line (nose, 220, 330, 240)

    //mouth 
    fill (0, 0, 0)
    ellipse (300, 260, 50, mouth)
}

function mousePressed() {
    faceWidth = random(350, 450);
    faceHeight = random(100, 200);
    eyes = random(20, 30);
    nose = random(240, 260);
    mouth = random(10, 40);
    eyes2 = random(20, 70);
    x = random (0, 255);
    y = random (0, 255);
    z = random (0, 255);
}

I found that with this project I had a much easier time setting everything up, and I feel as though I’m finally starting to get the hang of things. I still had a hard time attempting to make the face look more visually pleasing/aesthetic, but I am not mad with the results. Hopefully in future projects I will be able to produce a piece that is both functional (i.e. fulfills the requirements) and visually pleasing.

The design for the face came from a drawing I used to do a lot as a kid whenever I had a sketchbook. It’s pretty simplistic, but I thought that it could fit the goals of the project.

nahyunk1-Project-02-Variable-Face

sketch-124.js

  var eyeSize = 10;
  var faceWidth = 350;
  var faceHeight = 370;
  var red = 255;
  var green = 255;
  var blue = 255;

  function setup() {
      createCanvas(640, 480);
  }

  function draw() {
      background(red, green, blue);
      noStroke();
      smooth();
      //watermelon skin
      fill("green");
      arc(320, 240, faceWidth,  faceHeight, 0, PI, CHORD);
      //watermelon fruit inside
      fill("red");
      arc(320, 240, faceWidth-20, faceHeight-30, 0, PI, CHORD);
      //watermelon smiley mouth
      fill("orange");
      arc(320, 270, eyeSize, eyeSize, 0, PI, CHORD);
      //eyesizes&color
      var eyeLX = 640 / 2 - 20;
      var eyeRX = 640 / 2 + 20;
      fill("black");
      ellipse(eyeLX, 320-50, eyeSize, eyeSize);
      ellipse(eyeRX, 320-50, eyeSize, eyeSize);
  }

  function mousePressed() {
      faceWidth = random(100, 400);
      faceHeight = random(100, 350);
      eyeLX = random(250, 300);
      eyeRX = random(340, 370);
      eyeSize = random (10, 25);
      red = random (0, 255);
      green = random (0, 255);
      blue = random(0, 255);
  }

I really hoped to be able to change the color of the background while trying to make my slice of watermelon character. I made the character with arcs and ellipses.

BrandonHyun-Project-02-Variable Face

bhyun1-project02.js

//brandonhyun
// 15-104 Section B
//bhyun1@andrew.cmu.edu
//project-02

var eyeSize = 50;
var noseSize = 50;
var faceWidth = 300;
var faceHeight = 300;
var eyebrowslength = 180;


function setup() {
    createCanvas(640, 480);
    background(220);
}

function draw() {
//ears
  strokeWeight(5);
  //left Ear
  fill(219,153,52);
  ellipse(width/2.7 ,height/4.8 ,50,50);
  //RightEar
  fill(219,153,52);
  ellipse(width/2.7 + 170 , height/4.8 ,50,50);


//Shape of a face
  stroke(0);
  fill(219,153,52);
  ellipse(width/2,height/2,faceWidth,faceHeight);

  var eyeLX = width / 2 - faceWidth * 0.2;
  var eyeRX = width / 2 + faceWidth * 0.2;

//eye
  fill(0);
  ellipse(eyeLX,height/2.3,eyeSize/3,eyeSize/3);
  ellipse(eyeRX,height/2.3,eyeSize/3,eyeSize/3);
//eyebrows
fill(0);
strokeWeight(5);
strokeCap(ROUND);
line(eyeLX-30,eyebrowslength, eyeLX+30,eyebrowslength);
line(eyeRX-30,eyebrowslength, eyeRX+30,eyebrowslength);

//nose
fill(0);
ellipse(width/2,height/2 + 10,noseSize/3,noseSize/3);
fill(255);
noStroke();
ellipse(width/2 - 10,height/2 + 20,noseSize/2,noseSize/2);
fill(255);
noStroke();
ellipse(width/2 + 10,height/2 + 20,noseSize/2,noseSize/2);
}


function mousePressed() {

  eyebrowslength = random (100,200);
  eyeSize = random(10, 100);
  noseSize = random(10,50);

}

I was interested with the Character named Ryan from Kakao Talk, which is a messaging platform in South Korea. Everyone is obsessed with this character and this character became one of the icons for the Kakao co.

When I was working I wanted to recreate the character by myself by using codes and I also wanted to have some movements when the user is clicking.

Components that moves when there is a click are the eyebrows, eyes, and the nose. By having this movement it seems like Ryan is expressing different emotions.

merlebac Project-02 Section B

merlebac Project-02

// Matthew Erlebacher
// Section B
// merlebac@andrew.cmu.edu
// Assignment-02-A

/* For this assignment I used the example provide in the assignment
description as a starting point. I then used what I learned from
that to add my own details and variation to the assignment. */

// Global Parameter Variables

var eyeWidth = 30
var eyeHeight = 30
// Determines width and height of eyes

var faceWidth = 150
var faceHeight = 150
// Determines width and height of face

var lipWidth = 100
var lipHeight = 10
// Determines width and height of lip

var noseP1X = 315
var noseP1Y = 265
// Determines 1st point of triangle nose

var noseP2X = 320
var noseP2Y = 255
// Determines 2nd point of triangle nose

var noseP3X = 325
var noseP3Y = 265
// Determines 3rd point of triangle nose

var hornX = 250
var hornY = 150
// Determines last point of horns

var fangP3 = 300
// Determines fang length

// Global color Variables

var faceColorR = 255
var faceColorG = 255
var faceColorB = 255
// Determines the color combination of face

var eyeColorR = 255
var eyeColorG = 255
var eyeColorB = 255
// Determines color combination of eyes

var lipColorR = 255
var lipColorG = 255
var lipColorB = 255
// Determines color combination of lip

var noseColorR = 255
var noseColorG = 255
var noseColorB = 255
// Determines color of nose

var hornColorR = 255
var hornColorG = 255
var hornColorB = 255
// Determines color of the horns

var fangColorR = 255
var fangColorG = 255
var fangColorB = 255
// Determines color of the fangs

function setup() {
    createCanvas(640, 480);
    // Creates a black canvas
}

function draw() {
    background(0);
    
    fill(hornColorR, hornColorG, hornColorB);
    triangle(320, 270, 320, 210, hornX, hornY);
    // Creates left horn

    fill(hornColorR, hornColorG, hornColorB);
    triangle(320, 270, 320, 210, width - hornX, hornY);
    // Creates right horn

    fill(faceColorR, faceColorG, faceColorB);
    ellipse(width / 2, height / 2, faceWidth, faceHeight);
    // Creates a circle for the face
    
    var eyeLX = width / 2 - faceWidth * 0.25;
    var eyeRX = width / 2 + faceWidth * 0.25;
    // Chooses a coordinate for the eyes

    fill(fangColorR, fangColorG, fangColorB);
    triangle(280 + 0.1 * faceWidth, 280,
        290 + 0.1 * faceWidth, 280, 285 + 0.1 * faceWidth, fangP3);
    // Creates left fang

    fill(fangColorR, fangColorG, fangColorB);
    triangle(360 - 0.1 * faceWidth, 280,
        350 - 0.1 * faceWidth, 280, 355 - 0.1 * faceWidth, fangP3);
    // Creates right fang
    
    fill(lipColorR, lipColorG, lipColorB);
    rectMode(CENTER);
    // Centers rectangle
    rect(width / 2, height / 2 + 40,
        lipWidth, lipHeight);
    // Creates and chooses parameters of lip

    fill(eyeColorR, eyeColorG, eyeColorB);
    ellipse(eyeLX, height / 2, eyeWidth, eyeHeight);
    // Creates a left eye for the face
    
    fill(eyeColorR, eyeColorG, eyeColorB);
    ellipse(eyeRX, height / 2, eyeWidth, eyeHeight);
    // Creates a right eye for the face

    fill(noseColorR, noseColorG, noseColorB);
    triangle(noseP1X, noseP1Y, noseP2X, noseP2Y, noseP3X, noseP3Y);
    // Creates triangle as a nose

}

function mousePressed() {
// Shape randomizers

    eyeWidth = random(10, 50);
    eyeHeight = random(10, 50);
    // Randomizes the width and height of the eyes
    
    faceWidth = random(100, 200);
    faceHeight = random(100, 200);
    // Randomizes the width and height of the face

    lipWidth = random(75, 150);
    lipHeight = random(5, 15);
    // Randomizes the width and height of the lip

    hornX = random(150, 250);
    hornY = random(50, 150);
    // Randomizes the last poing of the horn

    noseP1X = random(305, 315);
    noseP1Y = random(255, 265);
    // Randomizes the 1st point of the nose

    noseP2X = random(315, 325);
    noseP2Y = random(245, 255);
    // Randomizes the 2nd point of the nose

    noseP3X = random(325, 335);
    noseP3Y = random(255, 265);
    // Randomizes the 3rd point of the nose

    fangP3 = random(300, 400);
    // Randomizes the bottom of the fang

// Color Randomizers

    faceColorR = random(0, 255);
    faceColorG = random(0, 255);
    faceColorB = random(0, 255);
    // Randomizes the color of the face

    eyeColorR = random(0, 255);
    eyeColorG = random(0, 255);
    eyeColorB = random(0, 255);
    // Randomizes the color of the eyes

    noseColorR = random(0, 255);
    noseColorG = random(0, 255);
    noseColorB = random(0, 255);
    // Randomizes the color of the nose

    lipColorR = random(0, 255);
    lipColorG = random(0, 255);
    lipColorB = random(0, 255);
    // Randomizes the color of the lip

    hornColorR = random(0, 255);
    hornColorG = random(0, 255);
    hornColorB = random(0, 255);
    // Randomizes the color of the horns

    fangColorR = random(0, 255);
    fangColorG = random(0, 255);
    fangColorB = random(0, 255);
    // Randomizes the color of the fangs

}

Working on this project was an interesting experience for me. I started out by just creating a regular face, and sort of hit a creativity block after that. I decided that it would be cool if the colors would constantly change against a black background so I made each color a variable. Finally, I decided to give the face fangs and horns in order to increase the variability, as well as make it more visually interesting.

mjanco – LookingOutwards02- Section B

Michelle Janco

LookingOutwards-02

Section B

I looked at the piece WAVES by Lia, created in 2016. WAVES is a generative installation that shows flowing virtual waves that continuously flow and never repeat the same way. I admire the beauty of this piece, as it appears like a moving painting. It does not change drastically, but with subtlety. The tiniest of details change and never repeat, which brings this scenic, digital “painting” to life. Lia describes that the direction of the waves is unchangeable, meaning the code written called for one directional movement. However, the patterns and layering of the waves themselves are always randomized, due to the randomized changes in details, rhythm, and scale. I also really liked that the project manifested into a backdrop for artistic performance, both enhancing itself and the performance, to make one beautiful piece. Lia shows that WAVES played at a concert, “Blades” behind the musicians. (link: http://www.liaworks.com/theprojects/waves/ ).

@C – Lâminas
(Pedro Tudela e Miguel Carvalhais) na Blackbox
2017.03.03 Gnration, Braga, Portugal
© André Henriques
www.facebook.com/ahphoto.portugal

 

atraylor – Looking Outwards 02 – Section B

I spent a long time looking through different creative coding pieces and settled on Hydra a generative shadow maker, by Nicolas Barradeau. This piece takes silhouettes of animals, people, and objects and splices them together based on cuts the user makes. This results in blob-like hydra creatures and very satisfying sounds that accompany the creature creation.

I admire that this project is simple and yet is still fascinating. Taking pieces of objects that are recognizable, simplifying them and allowing the user to make decisions, makes this piece accessible, and yet it’s frustrating and exciting when you don’t get the result you expected. This piece allows the viewer to use their imagination similar to looking for shapes in the clouds or watching shadow puppets on the wall.

Connie-Looking Outwards-02

The project that I found inspirational and interesting was the “Laser Forest (2013)” by Memo Akten.

Video of the “Laser Forest shown on Akten’s website.

What I admire most about the project is that it combines music, light, and interactivity to create a unique experience. The “forest” consists of rods and lasers which can be pulled, waved, twirled, etc. to create sound. Each tree is tuned to a specific note and the material used to create the forest has a “natural springiness” to it. I think the artist’s sensibilities were manifested in the algorithm through the emphasis on interacting with the musical rods to create something more than what is presently there (that is, the music; otherwise the forest is silent).

The forest’s algorithm was created using openFrameworks and Akten and his studio, Marshmallow Laser Feast, have posted their code and process on Github. There are files that map out the order of the 150 trees within the 450 sq.meters along with the specific note/frequency to which each “tree” is tuned to. I don’t know specifically how the algorithm works but in their source code, they have functions that I would imagine work similarly to the mousePresssed/mouseDragged functions which involve a conditional trigger in order to start an event (in this case, the trigger would be movement of the rods to trigger the tune from each tree).

cchau1 – Project02 – Variable Faces

sketch


var eyeSize = 35;
var whiteSize = 15;
var faceWidth = 200;
var faceHeight = 200;
var r, g, b
var noseX = 20
var noseY = 10
var whiteHeight = 100
var whiteWidth = 35
var pinkHeight = 120
var pinkWidth = 40
var bodyW = 200
var bodyH = 250

function setup() {
    createCanvas(480,640);
    angleMode(CENTER)
    smooth()
    r = random(255);
    g = random(255);
    b = random(255);
}

function draw() {
    noStroke();
    background(165,216,255);

//bunny ears
    noStroke()
    ellipseMode(RADIUS);
    fill(250,249,250);
    ellipse(290,180,whiteWidth,whiteHeight);

    ellipseMode(CENTER);
    fill(255,225,242);
    ellipse(290,180,pinkWidth,pinkHeight);

    ellipseMode(RADIUS);
    fill(250,249,250);
    ellipse(180,180,whiteWidth,whiteHeight);

    ellipseMode(CENTER);
    fill(255,225,242);
    ellipse(180,180,pinkWidth,pinkHeight);

//head
    fill(250,249,250);
    ellipse(width / 2, height / 2, faceWidth, faceHeight);
    var eyeLX = width / 2.5 - faceWidth * 0.25;
    var eyeRX = width / 2.5 + faceWidth * 0.25;

    fill(r,g,b); //applied r,g,b random color variables to eyes
    ellipse(eyeLX, height / 2, eyeSize, eyeSize);
    ellipse(eyeRX, height / 2, eyeSize, eyeSize);

    fill(255); //white eye shine
    ellipse(eyeLX-9, height / 2 -10, eyeSize/1.5, eyeSize/1.5);
    ellipse(eyeRX-9, height / 2 -10, eyeSize/1.5, eyeSize/1.5);

    fill(255,186,223); //nose
    ellipse((width/2)-50, height/2,noseX,noseY);

//body
    fill(250,249,250);
    ellipse(width/2,height-100,bodyW,bodyH);

//flower
    translate(300,265);
    noStroke()
   for (var i = 0; i < 10; i ++) {
     fill(r,g,b);
     ellipse(0, 10, 20, 60);
     rotate(PI/5)
}

}

function mousePressed() {
    var d = dist(mouseX, mouseY, 20,60);
    if (d < 500) {
      r = random(255);
      g = random(255);
      b = random(255);
    }
    faceWidth = random(170, 250);
    faceHeight = random(15, 250);
    eyeSize = random(20,60);
    whiteHeight = random(80,140);
    whiteWidth = random(20,50);
    pinkHeight = random(90,150);
    pinkWidth = random(20,40);
    bodyW = random(200,250);
    bodyH = random(250,300);

  }

I initially planned to have only the face, eyes, and ear length to change but decided to also add a random color-changing function which was applied to the eyes and additional flower function. As I was deciding the range for the random width/height for the head, I thought to myself that in nature, there are many beautiful mathematical proportions that have allowed species to thrive but in our imagination and in cartoons, these proportions can be as hilarious or wacky as we desire!

kyungak-Project-02-Variable-Face

sketch

//Kyunga Ko
//15104B
//kyungak@andrew.cmu.edu
//Assignment-02-Variable-Faces

var facewidth = 260;
var faceheight = 240;
var outerLx = 275;
var outerY = 200;
var eyesize = 40;
var outerRx = 370;
var pupilsize = 7
var nosewidth = 80;
var noseheight = 40;
var nostrilwidth = 5;
var nostrilheight = 10;
var mouthtip = 340;
var mouthheight = 290;
var mouthleft = 310;
var mouthright = 330;
var pupilcolor = 0;

function setup() {
    createCanvas(640,480);
    
}

function draw() {
    background(198,192,214);
//ears
    fill(228,162,194);

//face
    fill(245,216,230);
    strokeWeight(3);
    stroke(228,162,194);
    ellipse(320,240,facewidth,faceheight);

//eyes
    fill(255);
    stroke(0);
    ellipse(outerLx,outerY,eyesize,eyesize); //left outerpart of eye
    ellipse(outerRx,outerY,eyesize,eyesize); //right outerrpart of eye

    fill(pupilcolor);
    ellipse(outerLx,outerY,pupilsize,pupilsize); //left pupil
    ellipse(outerRx,outerY,pupilsize,pupilsize); //right pupil

//nose
    fill(234,217,225);
    ellipse(320,250,nosewidth,noseheight); //outerpart of nose

    fill(151,139,145);
    ellipse(300,250,nostrilwidth,nostrilheight); //left nostril
    ellipse(340,250,nostrilwidth,nostrilheight); //right nostril

//mouth
    fill(151,139,145); 
    triangle(mouthleft,mouthheight,width/2,mouthtip,mouthright,mouthheight); 
}

function mousePressed() {
    //when the user clicks, the variables are randomly reassigned
    //within the given ranges
    facewidth = random(250,350);
    faceheight = random(230,350);
    outerLx = random(250,275);
    outerY = random(170,200);
    pupilsize = random(5,25);
    nosewidth = random(50,150);
    noseheight = random(30,70);
    nostrilwidth = random(3,10);
    nostrilheight = random(5,15);
    mouthtip = random(300,347);
    mouthleft = random(250,315);
    mouthright = random(325,390);
    mouthheight = random(300,320);
    pupilcolor = random(0,255);
}

As someone who is just learning about this program, learning and experimenting with the “mousePressed” function was interesting. Although I encountered a few problems here and there, I was able to overcome them and learn from the mistakes. I have also attached my notebook sketch of how the face originally looked. Although the result doesn’t synchronize with the sketch, I believe I will be able to make more intricate designs as I learn to utilize more features on javascript.

dnam-Project02-Variable-Face

dnam-Project-02-Variable-Face

// Doo Won Nam
// 15-104 :: 1 Section B
// dnam@andrew.cmu.edu
// Project-02-Variable-Face

var faceWidth = 258
var faceHeight = 216
var eyebrowWidth = 78
var eyebrowHeight = 13
var maskHeight = 63
var mouthHeight = 24
var eyeWidth = 43
var eyeHeight = 30
var noseWeight = 18
var noseHeight = 74
var toothWidth = 19
var toothHeight = 14
var x = 640;
var dir = 1;
var speed = 10;

function setup() {
    createCanvas(640, 489);
}

function draw() {
  background(200, 147, 188);
  noStroke();
//hat
  fill(142, 79, 46);
  rect(144, 111, 362, 43);
  ellipse(325, 95, 340, 80);
//face
  fill(209, 158, 131);
  rect(190, 155, faceWidth, faceHeight);
  fill(248, 173, 133);
  rect(200, 155, faceWidth - 20, faceHeight - 10);
//eyebrows left then right
  fill("black");
  rect(209, 153, eyebrowWidth, eyebrowHeight);
  rect(335, 153, eyebrowWidth, eyebrowHeight);
//mask
  fill(95, 83, 76);
  rect(190, 166, faceWidth, maskHeight);
//mouth
  fill(185, 79, 79);
  rect(270, 318, 130, mouthHeight);
  ellipse(335, 317, 130, 24);
//teeth
  fill("white");
  rect(300, 305, toothWidth, toothHeight);

  rect(330, 305, toothWidth, toothHeight);
//left eye
  fill("white");
  ellipse(248, 190, eyeWidth, eyeHeight);
  fill("black");
  ellipse(245, 190, eyeWidth - 24, eyeHeight - 12);
  fill("white");
  ellipse(240, 185, eyeWidth - 30, eyeHeight - 20);
//right eye
  fill("white");
  ellipse(366, 197, eyeWidth * 1.5, eyeHeight * 1.5);
  fill(0);
  ellipse(363, 197, eyeWidth * 1.5 - 32, eyeHeight * 1.5 - 20);
  fill("white");
  ellipse(358, 192, eyeWidth * 1.5 - 45, eyeHeight * 1.5 - 30);
//nose
  fill(209, 158, 131);
  rect(285, 212, noseWeight, noseHeight);
  ellipse(284, 276, noseWeight + 2, noseHeight - 54);

}
//random change in width/height everytime mouse is pressed
function mousePressed() {
      eyebrowWidth = random(50, 78);
      eyebrowHeight = random(1, 30);
      maskHeight = random(20, 80);
      mouthHeight = random(24, 50);
      eyeWidth = random(23, 63);
      eyeHeight = random(20, 40);
      noseWeight = random(9, 21);
      noseHeight = random(50, 90);
      toothWidth = random(15, 24);
      toothHeight = random(10, 20);
}

Basing the face on classic cartoon image of a thief (with the line mask) and toast, I wanted to use the mousePress function to make it almost seem like the thief is surprised after being caught by the police. Using variables to make the placements and size of the facial parts easier, I was able to produce an efficient code for a interactive face.