thlai-Project-02-Variable-Face


thlai-project02

// Tiffany Lai
// 15-104 Section A
// thlai@andrew.cmu.edu
// Project-O2

var eyeSize = 0;
var mouth1 = 60;
var mouth2 = 120;
var skinR = 210;
var skinG = 210;
var skinB = 210;
var eyebrows = 275;
var eyebrowStroke = 10;
var snout = 115;
var jaw1 = 240;
var jaw2 = 200;

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

function draw() {
    background(255, 250, 230);
    noStroke();

    fill(skinR, skinG, skinB);
    beginShape(); // left ear
        curveVertex(220, 260);
        curveVertex(220, 260);
        curveVertex(180, 100);
        curveVertex(120, 100);
        curveVertex(170, 280);
        curveVertex(170, 280);
    endShape(); 

    beginShape(); // right ear
        curveVertex(250, 280);
        curveVertex(250, 280);
        curveVertex(300, 100);
        curveVertex(350, 100);
        curveVertex(310, 280);
        curveVertex(320, 280);
    endShape();

    ellipse(width/2, height/2, 200, 200); // head top
    ellipse(width/2, height/2+40, jaw1, jaw2); // head bottom

    fill(255);
    ellipse(width/2, height/2+60, snout, snout); // snout

    fill(70);
    ellipse(width/2-50, height/2, eyeSize+20, eyeSize+30); // left eye
    ellipse(width/2+50, height/2, eyeSize+20, eyeSize+30); // right eye

    push();
    stroke(skinR-20, skinG-20, skinB-20);
    strokeWeight(eyebrowStroke);
    line(178, eyebrows, 198, eyebrows-5); // left eyebrow
    pop();

    push();
    stroke(skinR-20, skinG-20, skinB-20);
    strokeWeight(eyebrowStroke);
    line(300, eyebrows, 280, eyebrows-5); // right eyebrow
    pop();

    fill(250, 225, 235);
    triangle(width/2-10, height/2+30, width/2+10, height/2+30, width/2, height/2+50); // nose

    fill(255, 100, 140);
    arc(width/2, height/2+60, 80, 80, mouth1, mouth2); // mouth
}

function mousePressed() {
    eyeSize = random(-10, 20);
    mouth1 = random(-10, 80);
    mouth2 = random(100, 190);
    skinR = random(200, 240);
    skinG = random(200, 240);
    skinB = random(200, 240);
    eyebrows = random(240, 300);
    eyebrowStroke = random(5, 20);
    snout = random(95, 150);
    jaw1 = random(220, 250);
    jaw2 = random(175, 210);
}

 

monicah1-LookingOutward-02

This is Serpentine Gallery Pavilion 2002 by Toyo Ito and Cecil Balmond. The structure is constructed based on algorithm of a cube, providing a geometrical pattern. Then Ito and Balmond re-interpreted the pattern, considering the function and spatial structure. I am instrigued by the combination of an individual design intention and the quantitative and qualitative computer generated data, create such beautiful structure. I am interested in the design process interrelate with the new tool: computer generated data. How computer generated data influence the design and how design process affect the how the computer data was generated and analyzed. Moreover, I am interested in the possibilities of applying algorithms inspired by natural process, translating numbers into computational patterns, to sculpture, and to living space. I love seeing living space integrated back to nature, which is where everything begin with.

http://www.bcs.org/upload/pdf/ewic_ev14_s2paper2.pdf

dchikows-Section C-Project-02-Variable Face

sketch

// David Chikowski
// Section C
// dchikows@andrew.cmu.edu
// Project-02



var eyeSize = 12;
var backFinTopX = 541;
var backFinTopY = 162;
var backFinBottomX = 540;
var backFinBottomY = 322;
var mouthOpenTopY = 234;
var mouthOpenBottomY = 245;



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

function draw() {
    background(130,163,196);

    noStroke();
    fill(191,94,71);
    ellipse(279,238,359,131);
    //Main body

    noStroke();
    fill(191,94,71);
    quad(80,231,139,202,136,277,81,248);
    //mouth

    noStroke();
    fill(130,163,196);
    triangle(79,mouthOpenTopY,80,mouthOpenBottomY,103,242);
    //mouth opening

    noStroke();
    fill(56,54,8);
    ellipse(137,232,eyeSize,eyeSize);

    noStroke();
    fill(191,94,71);
    triangle(240,145,205,182,336,188);
    //top fin

    noStroke();
    fill(191,94,71);
    triangle(backFinTopX, backFinTopY, 403, 242, backFinBottomX, backFinBottomY);
    //Back fin


}


function mousePressed() {
    // when the user clicks, these variables are reassigned
    // to random values within specified ranges. For example,
    // 'eyeSize' gets a random value between 12 and 22.

    eyeSize = random(12,22);
    backFinTopX = random(525, 541);
    backFinTopY = random(145, 162);
    backFinBottomX = random(515, 540);
    backFinBottomY = random(295, 322);
    mouthOpenTopY = random(234,246);
    mouthOpenBottomY = random(235,245);



}











I enjoyed this project as it was our first animation type project. I found it challenging because I don’t quite understand what the program is exactly doing as well as I would like. Although I am excited to learn more to create better animations in the future.

*I am not sure why the canvas is getting cut off.

eeryan-Project-02-VariableFace

sketch

//Erin Ryan
//eeryan@andrew.cmu.edu
//Lecture 1, Section C
//Project 02
var eyeSize = 20;
//face variables
var faceWidth = 100;
var faceHeight = 150;
var wink = 1;
//mouth variables
var mouthXone = 120;
var mouthXtwo = 140;
var mouthYone = 190;
var mouthYtwo = 190;
var mouthWidth = 10;
var mouthHeight = 10;
var mouthNumber = 1;
var rB = 40;
//body variables
var shoulderHeight = 265;
 
function setup() {
    createCanvas(300,300);
}
 
function draw() {
    background(255,255,210);
    //phone
    noStroke();
    fill(193,93,101);
    quad(45,140,70,150,70,212,45,200);
    var eyeY = height/2;//eye height
    //arm
    noFill();
    stroke(152,196,249);
    strokeWeight(10);
    beginShape();
    curveVertex(50,170);
    curveVertex(50,170);
    curveVertex(50,180);
    curveVertex(50,280);
    curveVertex(100,310);
    curveVertex(110,310);
    endShape();
    //shoulders
    noStroke();
    fill(50,80,109);
    rect(75,shoulderHeight,170,100,25,25,25,25);
    //face
    stroke(152,196,249);
    fill(197,255,237);
    strokeWeight(5);
    rect(100, 75, faceWidth,  faceHeight,25,25,40,40);
    var eyeLX = width / 2 - faceWidth * 0.25-10;
    var eyeRX = width / 2 + faceWidth * 0.25-10;
    stroke(50,80,109);
    noFill();
    //left eye
    strokeWeight(3);
    ellipse(eyeLX, eyeY, eyeSize, eyeSize);
    //mouth
    if(mouthNumber==1){
      noStroke();
      fill(193,93,101);
      arc(mouthXtwo, mouthYtwo, mouthWidth, mouthHeight,0,PI);
    }
    if(mouthNumber==2){
      stroke(193,93,101);
      line(mouthXone,mouthYone,mouthXtwo,mouthYone);
    }
    if(mouthNumber==3){
      noStroke();
      fill(193,93,101);
      ellipse(mouthXone,mouthYone,mouthWidth,mouthHeight);
    }
    //right eye
    if(wink==1){
      stroke(50,80,109);
      line(eyeRX-5, height/2,eyeRX+5, height/2);
    }
    else{
    noFill();
    stroke(50,80,109);
    ellipse(eyeRX, height / 2, eyeSize, eyeSize); 
    }
    
}
 
function mousePressed() {
    // when the user clicks, these variables are reassigned
    // to random values within specified ranges. For example,
    // 'faceWidth' gets a random value between 75 and 150.
    faceWidth = random(75, 150);
    faceHeight = random(120, 180);
    eyeSize = random(10,20);
    mouthXone = random(120,130);
    mouthXtwo = random(140,150);
    mouthYone = random(180,190);
    mouthYtwo = random(155,165);
    mouthXthree = random(110,120);
    mouthYthree = random(155,165)
    mouthWidth = random(10,35);
    mouthHeight = random(5,25);
    mouthNumber = Math.floor((random()*3)+1);
    wink = Math.floor((random()*3)+1);
    eyeY = height/2 +(Math.floor((random()*7)+1));
    shoulderHeight = random(265,230);
    
}

I started off by tweaking the original template, finding slight differences like making the height of the eyes unequal, changing the radius of the curves of the face rectangle and adding strokes to different elements. I chose a color palette that I thought worked well with the simplistic faces I created, primarily desaturated primary colors.

After toying with conditionals and tweaking elements to give my faces different expressions, I decided that adding the context of a cell phone would tie my piece together. The different faces dictate how the phone is being used – are they taking a selfie? did they just read a text that irritated them?

sophiaq – Project2-VariableFace

sketch

//Sophia Qin
//15-104 Section B
//sophiaq@andrew.cmu.edu
//Project-02
var eyeSize = 20;
var faceWidth = 200;
var faceHeight = 250;
var eyeBrowHeight = 50;
var color = 50;
var hair = 30;

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

function draw() {
    //structure of the face
    background(255,color,0);
    //face is mid of canvas
    fill(0,0,color);
    strokeWeight(5);
    fill(color,200,20);
    ellipse(width/2,height/2,faceWidth,faceHeight);
    //eye position
    var eyeLX = width/2-faceWidth*0.25;
    var eyeRX = width/2+faceWidth*0.25;
    //drawing eye
    fill(50);
    ellipse(eyeLX, height / 2, eyeSize, eyeSize);
    ellipse(eyeRX, height / 2, eyeSize, eyeSize);
    //minieye
    fill(255);
    ellipse(eyeLX,height/2,eyeSize*0.5,eyeSize*0.5);
    ellipse(eyeRX,height/2,eyeSize*0.5,eyeSize*0.5);
    //eyebrow
    noFill();
    arc(eyeLX,height / 2,50,eyeBrowHeight, PI, 7/4*PI);
    arc(eyeRX,height / 2,50,eyeBrowHeight,PI+QUARTER_PI,0);
    //white mouth
    fill(255);
    ellipse(width/2, (height/2)+40,faceWidth/3,faceHeight/4);
    //mouth inside
    fill(color,0,10);
    ellipse(width/2, (height/2)+40+(faceHeight/8),faceWidth/4,faceHeight/6);
    //cheeks
    fill(250,192,255)
    ellipse(eyeLX,height/2+30,faceWidth/5,faceHeight/9);
    ellipse(eyeRX,height/2+30,faceWidth/5,faceHeight/9);
    //hair
    fill(20,39,hair);
    quad(width/2,height/2-(faceHeight/2)+30,(width/2)+faceWidth/2,height/2-(faceHeight/8),
        eyeRX,faceHeight/2,eyeLX,faceHeight/2);
    quad(width/2,height/2-(faceHeight/1.3),(width/2)+faceWidth/2,height/2-(faceHeight/1.3),
        eyeRX,faceHeight/2,eyeLX,faceHeight/2);
    quad(width/2+3,height/2-(faceHeight/1.3),(width/3)+faceWidth/3,height/2-(faceHeight/1.3),
        eyeRX,faceHeight/2+3,eyeLX+30,faceHeight/2);
}
    

function mousePressed() {
    //when the user clicks, the variables are reassigned
    //to random values within specified ranges. For example,
    //'face width' gets a random value between 75 and 150
    faceWidth = random(230, 300);
    faceHeight = random(220, 300);
    eyeSize = random(10, 40);
    eyeBrowHeight = random(30,80);
    color = random(100,255);
    hair = random(0,190);
}

I wanted the face shaped to be relatively similar and I wanted to look cartoony. I didn’t sketch out beforehand, and I figured out my plan of changing colors, sizes, hair, etc along the way

svitoora – 02 Looking Outwards

Digitally generated column head.

Michael Hansmeyer‘s Generative Columns 

The artist worked alone to digitally generate these column, but collaborated with others to technically execute these into physical objects. Each column starts off with a cube. The cube is then algorithmically folded along certain “humanly invisible” spots. These “humanly invisible” spots refers to the mathematical maxima or minima on the surfaces of the object based on certain mathematical interpretations such as: tangency, tension, normals ,etc.

Digitally generated column physically existing thanks to laser-cutting.

Columns are exemplars of the century. From the Chinese to the Greeks, columns carry with them the aesthetic and moral values of the culture at a given point in time. Task with the job to design columns for 21st century, Hansmeyer decided to digitally generate these column and made them from stacking laser cut paper. According to Hansmeyer, the 21st century can be classified by the rise of the Digital Age and algorithms, therefore columns that are permuted and generated digitally by the computer to exemplify this era’s aesthetic seems appropriate.

Algorithmically generated details of the column. Architecturally, these fine details would be humanly impossible to plan and render, but currently it’s made possible by the computer.

myoungsh-project02-variableface

sketch

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

//legs
var standing = 10;

//arms
var armLength = 50;

//face
var faceWidth = 175;
var faceHeight = 125;
var faceX = 330;
var faceY = 250;
var corner1 = 10;
var corner2 = 20;
var corner3 = 30;
var corner4 = 40;

//eyes
var eyeSize = 20;
var eyeLX = 450;
var eyeRX = 400;

//mouth
var mouthX = 425;
var mouthY = 355;
var mouthWidth = 50;
var mouthHeight = 35;

//lips
var lips = 10;

//thing
var thingX = 200;
var thingY = 100;
var thingWidth = 20;
var thingHeight = 15;

//face color
var colorFg = 210;
var colorFb = 210;

//eye+mouth color
var colorE = 100;

//lips color
var colorLg = 70;
var colorLb = 70;

//thing color
var colorTHr = 210;
var colorTHg = 210;
var colorTHb = 240;

//background color
var colorBr = 225
var colorBg = 250

function draw() {
    background(colorBr, colorBg, 256);
    
    //legs
    strokeWeight(0)
    fill(0)
    rect(425+standing, 350, 5, 200);
    
    strokeWeight(0)
    fill(0)
    rect(405+standing, 350, 5, 200);
      
    //arms
    strokeWeight(0)
    fill(0)
    rect(230+armLength, 325, 350-(armLength*1.5), 5)
    
    //face
    strokeWeight(0)
    fill(245, colorFg, colorFb)
    rect(faceX, faceY, faceWidth, faceHeight, 
    corner1, corner2, corner3, corner4);
    
    //left eye
    strokeWeight(0)
    fill(colorE)
    ellipse(eyeLX, 320, eyeSize, eyeSize);
   
    //right eye
    strokeWeight(0)
    fill(colorE)
    ellipse(eyeRX, 320, eyeSize, eyeSize);
    
    //mouth
    strokeWeight(lips)
    stroke(256, colorLg, colorLb)
    fill(colorE-30)
    ellipse(mouthX, mouthY, mouthWidth, mouthHeight);
    
    //eyes
    eyeSize = random(10, 30);
    
    //thing
    strokeWeight(0)
    fill(colorTHr, colorTHg, colorTHb)
    rect(thingX, thingY, thingWidth, thingHeight, 
    corner1/2, corner2/2, corner3/2, corner4/2);    
    
    //thing
    thingX = random(100, 300)
    thingY = random(75, 125)
    thingWidth = random(10, 35)
    thingHeight = random(10, 35)
}
 
function mousePressed() {
    //legs
    standing = random(0, 25)
    
    //arms
    armLength = random(0, 100)
    
    //face
    faceWidth = random(150, 180);
    faceHeight = random(130, 150);
    faceX = random(320, 350);
    faceY = random(240, 270);
    corner1 = random(0, 50)
    corner2 = random(0, 50)
    corner3 = random(0, 50)
    corner4 = random(0, 50)

    //eyeX
    eyeLX = random(380, 420);
    eyeRX = random(430, 470);
    
    //mouth
    mouthX = random(420, 430);
    mouthY = random(350, 360);
    mouthWidth = random(40, 60);
    mouthHeight = random(30,40);

    //lips
    lips = random(5, 10);

    //face color
    colorFg = random(180, 220);
    colorFb = random(75, 150);
    
    //eye color
    colorE = random(50, 200);
    
    //lips color
    colorLg = random(75, 125);
    colorLb = random(75, 125);
    
    //thing color
    colorTHr = random(200, 220);
    colorTHg = random(200, 220);
    colorTHb = random(230, 250);
    
    //background color
    colorBr = random(215, 256);
    colorBg = random(245, 256);

}

 

dayoungl – Project02

sketch

//Sharon Lee
//Section E
//dayoungl@andrew.cmu.edu
//Project-02
var eyeDepth = 100;
var eyeLevel = 175;
var faceWidth = 250;
var faceHeight = 330;
var earWidth = 20;
var earLength = 120;

function setup() {
    createCanvas(400, 600);
    angleMode(DEGREES);
}
//create a face of a Moai sculpture
function draw() {
    background(170,195,227);
    //ears
    fill(121,117,130);
    noStroke();
    rect(60,eyeLevel+20,earWidth,earLength);
    rect(320,eyeLevel+20,earWidth,earLength);
    //face shape
    fill(74,72,77);
    noStroke();
    rect(75,75, faceWidth,faceHeight);
    arc(width/2,75,faceWidth,60,180,0);
    arc(width/2,400,faceWidth,80,0,180);
    //eyehole
    fill(32,31,39);
    arc(width/2,eyeLevel,faceWidth,eyeDepth,180,0);
    //nose
    fill(121,117,130);
    arc(width/2,eyeLevel,60,45,180,0);
    quad(170,eyeLevel,230,eyeLevel,240,300,160,300);
    var noseTip = 300;
    var noseWidth = 80;
    fill(59,57,62);
    noStroke();
    arc(width/2,noseTip,noseWidth,noseWidth-45,0,180);
}


function mousePressed() {
    earLength = random(100,150);
    eyeLevel = random(150,185);
    eyeDepth = random(70,140);
      
}

Moai Fam

katieche – looking outwards 02

HE_Mesh


After looking through some of the creators’ works and researching definitions, I felt still confused by the concept of generative art. However, of all the creators I looked at, the work of Frederik Vanhoutte caught my attention. He created amazing HE_mesh works, purely as a hobby which I respect. HE_Mesh* is a Java library for making polygonal mesh creations. It contains no display functionality of its own, but it’s meant to be used with processing. Vanhoutte describes the program as an “after-hours hobby” and is more of a toy than worth production strength. You can see a few of his works below.

hqq-secE-project02-variable-faces

hamza

//hamza qureshi
//section e
//project 02
//hqq@andrew.cmu.edu

//here's carl, y'all!

//background color variables
var R_bg = 20;
var G_bg = 225;
var B_bg = 255;
//arm variables
var y_armleft = 400;
var y_armright = 380;
//head variables
var width_head = 280;
var height_head = 90;
var color_head = 120;
//mouth variables
var width_mouth = 200;
var height_mouth = 40;
var color_mouth = 190;
var strokeColor_mouth = 235;
//eyes variables
var rad_eyes = 15;
var rad_pupil = 7;
var x_eye1 = 23

function setup(){
    createCanvas(640,480);
    rectMode(RADIUS);
    ellipseMode(RADIUS);
    angleMode(DEGREES);
}

function draw(){
    //background
    background(R_bg,G_bg,B_bg);
    //arms
    strokeWeight(20);
    stroke(0,0,color_head - 50);
    line(160,445,100,y_armleft + 5);
    stroke(0,0,color_head);
    line(160,440,100,y_armleft);
    line(485,440,545,y_armright);
    //body
    fill(0,0,color_head - 50);
    strokeWeight(0);
    rect(width/2-30,height/2+150,150,150,20);
    fill(210,180,180);
    stroke(0,0,color_head);
    strokeWeight(40);
    rect(width/2,height/2+150,150,150,20);
    //head
    strokeWeight(0);
    fill(0,0,color_head-50);
    rect(width/2-30,height/2+5,width_head+30,height_head+5,20);
    fill(0,0,color_head);
    rect(width/2,height/2,width_head,height_head,20);
    //mouth
    fill(color_mouth,20,86);
    strokeWeight(10);
    stroke(strokeColor_mouth,30,100);
    rect(width/2,height/2+40,width_mouth,height_mouth,20);
    if (width_head >= 0){
      width_mouth = width_head-20;
    }
    //eyes
    fill(255,255,255);
    strokeWeight(3);
    stroke(0,0,0);
    var left_eye = width/3-height_head*0.5
    var right_eye = left_eye + width/2
    ellipse(left_eye,height/2-30,rad_eyes,rad_eyes);
    ellipse(right_eye,height/2-30,rad_eyes,rad_eyes);
    fill(0,0,0);
    strokeWeight(0);
    ellipse(left_eye,height/2-30,rad_pupil,rad_pupil);
    ellipse(right_eye,height/2-30,rad_pupil,rad_pupil);
    if (rad_eyes >= 0){
      rad_eyes > rad_pupil
    }


}

function mousePressed(){
    R_bg = random(0,40);
    G_bg = random(200,245);
    B_bg = random(245,255);
    width_head = random(200,250);
    height_head = random(110,140);
    color_head = random(120,210);
    width_mouth = random(210,290);
    height_mouth = random(10,30);
    color_mouth = random(180,220);
    strokeColor_mouth = random(235,255);
    rad_eyes = random(10,20);
    rad_pupil = random(2,8);
    y_armleft = random(390,460);
    y_armright = random(390,460);



}

For my variable face project, I made Carl, a frantic little buddy who’s a bit nervous about Picture Day. The photographer keeps snapping photographs, and in each one, he expresses his anxiety by how agape his mouth his, h0w dilated his eyes are, and the way he waves his hands.