Philip Gates – Project-02-Variable-Face

gates-face2

//initialize variables to be randomized
var faceWidth = 480;
var eyeSize = 240;
var eyeColorR = 19;
var eyeColorG = 175;
var eyeColorB = 26;
var noseSize = 350;
var stacheWidth = 3;

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

function draw() {

    background(255);

    //head
    fill(242,208,239);
    noStroke();
    ellipse(240,240,faceWidth,640);

    //eyes
    stroke (0);
    strokeWeight (1);
    fill(255);
    ellipse(144,240,eyeSize,eyeSize);
    ellipse(336,240,eyeSize,eyeSize);

    //iris
    fill(eyeColorR, eyeColorG, eyeColorB);
    noStroke();
    ellipse(144, 240, eyeSize / 2, eyeSize /2);
    ellipse(336, 240, eyeSize / 2, eyeSize /2);

    //pupils
    fill(0)
    noStroke();
    ellipse(144,240,eyeSize/5,eyeSize/5);
    ellipse(336,240,eyeSize/5,eyeSize/5);

    //nose
    fill(218,0,165);
    triangle (240,noseSize,216,425,264,425);

    //mustache
    stroke(40,17,0);
    strokeWeight(stacheWidth);
    line(80,441,80,466);
    line(90,444,90,469);
    line(100,447,100,472);
    line(110,450,110,475);
    line(120,453,120,478);
    line(130,454,130,480);
    line(140,456,140,482);
    line(150,458,150,484);
    line(160,459,160,485);
    line(170,460,170,486);
    line(180,461,180,487);
    line(190,462,190,488);
    line(200,463,200,489);
    line(210,463,210,489);
    line(220,463,220,489);
    line(230,463,230,489);
    line(240,463,240,489);
    line(250,463,250,489);
    line(260,463,260,489);
    line(270,463,270,489);
    line(280,463,280,489);
    line(290,462,290,488);
    line(300,461,300,487);
    line(310,460,310,486);
    line(320,459,320,485);
    line(330,458,330,484);
    line(340,456,340,482);
    line(350,454,350,480);
    line(360,453,360,478);
    line(370,450,370,475);
    line(380,447,380,472);
    line(390,444,390,469);
    line(400,441,400,466);

    //mouth
    noFill();
    stroke(218,0,165);
    strokeWeight(5);
    arc(240,345,576,310,0,PI);

    //hat
    fill(0);
    noStroke();
    arc(240,0,350,200,0,PI);
}

//change face dimensions when mouse is clicked
function mousePressed() {
    faceWidth = random(200,480);
    eyeSize = random(50, 288);
    eyeColorR = random(0,255);
    eyeColorG = random(0,255);
    eyeColorB = random(0,255);
    noseSize = random(300,450);
    stacheWidth = random(0,15);
}

I chose to continue working with my face project from last week. In doing so, I learned why hard-coding numbers can make things difficult down the line: when I changed the canvas size my face didn’t fit in the frame, and after changing that I needed to adjust quite a few numbers to make the proportions match on the facial features. In future I will plan to create more variables and do much less hard-coding of numbers.

Sarah Yae – Project 02 – Variable Face

sketch

//Sarah Yae
//Section B
//smyae@andrew.cmu.edu
//Project-02

var faceX = 240
var faceY = 320
var facecolor = 255

var earX = 180
var earY = 200
var earlength = 60
var earwidth = 60

var eyeX = 200
var eyeY = 300
var eyecolor = 120

var noseX = 240
var noseY = 340
var nosewidth = 10

var mouth = 80
var mouthx1 = 200
var mouthx2 = 280

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

function draw() {
	background (255,229,204);

//draws the face in first frame
	noStroke();
	fill(facecolor);
	ellipse (faceX, faceY,230,230);

//draws the left ear in first frame
	noStroke();
	fill(facecolor);
	ellipse (earX, earY, earwidth, earlength);

//draws the right ear in first frame
    noStroke();
    fill(facecolor);
    ellipse (earX + 120, earY, earwidth, earlength);

//draws the left eye in first frame
    noStroke();
    fill (eyecolor);
    ellipse (eyeX, eyeY, 40, 40);

//draws the right eye in first frame
    noStroke();
    fill(eyecolor);
    ellipse (eyeX + 80, eyeY,40,40);

//draws the nose in first frame 
    noStroke();
    fill (204,204,255);
    ellipse (noseX, noseY, nosewidth, 30);

//draws the mouth in first frame 
    noStroke();
    fill (255,204,204);
    triangle (mouthx1,370,mouthx2,370,240,400);

}

function mousePressed() {

//face changes color
    faceX = 240;
    faceY = 320;
    facecolor = random(140,255);

//ears changes size (lengths and widths)
    earX = 180;
    earY = 200;
    earlength = random(50,130);
    earwidth = random(50,100);

//eyes changes color 
    eyeX = 200;
    eyeY = 300;
    eyecolor = random (10,120);

//nose changes size (width)
    noseX = 240;
    noseY = 340;
    nosewidth = random(10,40);

//mouth changes size (width)
    mouth = 80;
    mouthx1 = random (180,220);
    mouthx2 = random (260,300);

}

I wanted to create a cute, fantasy creature. By pressing the mouse, you can see my animal switch up from a mouse, a bunny, a bear, etc… you name it!

Victoria Reiter Project-02-Variable-Face

sketch

/*Victoria Reiter
Section B
vreiter@andrew.cmu.edu
Project-02-Variable-Face
*/

// defines coordinate position of freckle
var freckleX = 285;
var freckleY = 335;
// defines an increment value to be used under function mouseClicked()
var increment = 5;
// defines dimensions of pupils
var pupilWidth = 30;
var pupilHeight = 30;
// defines dimensions of the whites of the eyes
var whiteEyeWidth = 80;
var whiteEyeHeight = 80;
// defines dimensions of the irises of the eyes
var irisWidth = 55;
var irisHeight = 55;
// defines coordinates of the "point" of the nose
var pointyNoseX = 220;
var pointyNoseY = 325;
// defines y coordinates of the ears and inner ears
var earY = 260;
var innerEarY = earY + 5;
// defines dimensions of the mouth
var mouthWidth = 110;
var mouthHeight = 70;
// declares RGB values for hair
var hairColorR = 255;
var hairColorG = 255;
var hairColorB = 0;
// declares RGB values for irises of eyes
var irisColorR = 0;
var irisColorG = 102;
var irisColorB = 102;
// declares RGB values for hat
var hatColorR = 0;
var hatColorG = 76;
var hatColorB = 153;
// declares RGB values for hat band
var hatBandColorR = 0;
var hatBandColorG = 0;
var hatBandColorB = 51;

function setup() {
    // establishes canvas
    createCanvas(640, 480);
    background(220);
    // establishes background color
    background('rgb(153, 255, 204)');
    // writes a short message
    text("~V's Self-Portrait~", 10, 15);
}
function draw() {
    // reestablishes background now in dunction (draw)
    background(220);
    background('rgb(153, 255, 204)');
    noStroke();
    // Skin color
    fill('rgb(255,204,153)'); 
    //head
    ellipse(250, 285, 270, 290); 
    //ears
    ellipse(385,earY,50,70);
    ellipse(115,earY,50,70);
    noStroke();
    // inner ear color
    fill('rgb(255, 153, 153)'); 
    //inner ears
    ellipse(390,earY,30,50);
    ellipse(110,earY,30,50);
    //nose
    triangle(255,331,240,350,pointyNoseX,pointyNoseY);
    noStroke();
    // cheek blush color
    fill(255,204,204); 
    // cheek blush
    ellipse(185,335,60,25);
    ellipse(315,335,60,25);
    noStroke();
    // hairColor
    fill(hairColorR,hairColorG,hairColorB); 
    // hair
    quad(145,175,190,175,165,265,125,230);
    quad(180,175,215,175,245,260,230,245);
    quad(260,175,305,175,315,255,285,235);
    quad(315,175,355,175,370,220,335,245);
    noStroke();
    // hat color
    fill(hatColorR,hatColorG,hatColorB); 
    //hat
    ellipse(250, 190, 300, 75); 
    ellipse(210,140,110,150);
    ellipse(292,140,110,150);
    noStroke();
    // hat band color
    fill(hatBandColorR,hatBandColorG,hatBandColorB); 
    // hat band
    rect(155,152.5,192,30);
    // eye outline color
    stroke('rgb(0,158,255)');
    // white of eyes color
    fill('rgb(255, 255, 255)');
    // white of eyes
    ellipse(200,285,whiteEyeWidth,whiteEyeHeight);
    ellipse(305,285,whiteEyeWidth,whiteEyeHeight);
    // outline of mouth color
    stroke('rgb(102,0,51)');
    // mouth
    arc(250,360,mouthWidth,mouthHeight,0,PI,CHORD);
    noStroke();
    // irises
    fill(irisColorR,irisColorG,irisColorB);
    ellipse(200,272,irisWidth,irisHeight);
    ellipse(305,272,irisWidth,irisHeight);
    noStroke();
    // pupils
    fill('rgb(0,0,0)');
    ellipse(200,260,pupilWidth,pupilHeight);
    ellipse(305,260,pupilWidth,pupilHeight);
    noStroke();
    // freckle color
    fill('rgb(153,76,0)');
    // freckle
    ellipse(freckleX,freckleY,10,10);
}
    function mouseClicked() {
    // makes random variations occur in the portrait
    // moves freckle randomly about the face
    freckleX = random(150,350);
    freckleY = random(325,375);
    // changes size of the whites of eyes, pupils, and irises
    whiteEyeWidth = random(80,110);
    whiteEyeHeight = random(80,110);
    irisWidth = random(60,75);
    irisHeight = random(60,75);
    pupilWidth = random(25,55);
    pupilHeight = random(25,55);
    // changes nose shape or "pointiness"
    pointNoseX = random(185,245);
    pointyNoseY = random(305,345);
    // moves the ears up and down
    earY = random(250,270);
    // changes size of the mouth
    mouthWidth = random(40,150);
    mouthHeight = random(25,95);
    // changes color of the hair (warm colors)
    hairColorR = random(155,255);
    hairColorG = random(155,255);
    // changes color of the irises (cool colors)
    irisColorR = random(0,155);
    irisColorG = random(155,200);
    irisColorB = random(155,255);
    // changes color of the hat (completely random)
    hatColorR = random(0,255);
    hatColorG = random(0,255);
    hatColorB = random(0,255);
    // changes color of the hat band (grey scale)
    hatBandColorR = random(0,255);
    hatBandColorG = hatBandColorR;
    hatBandColorB = hatBandColorG;
}

In this project, I adapted my face from the week 1 project, and selected several variables to change randomly/within constraints. With a click of the mouse, my freckle moves across the screen, the sizes of the whites of my eyes, irises, and pupils change, the pointiness of my nose changes, my ears move up and down, my mouth changes size, my hair changes color (but sticks to warm colors), my irises change color (but stick to cool colors), my hat changes color randomly, and the band of my hat changes color along a grey scale.

I decided to use the basis of my face from the first project because I knew I would already have a LOT of difficulty figuring out the mechanics of this week’s task. And I did !!! I had no idea what was going on !!!!!!! So an immense enormous thank you to help from TAs Rain and Simin, who helped explain to me some concepts of how variables work and how declaring them and assigning them can be util for this and future tasks.

Furthermore, I adapted my code by adding in comments which I did not include in week one, cleaning up indentations and semicolons, and switching from hsl to rgb because I think it is a little easier to use and helpful for this project.

(((Again, THANK YOU TAs, I AM LESS HOPELESS WITH YOUR HELP)))

Alessandra Fleck – Project-02-Variable Face

sketch

//Name: Alessandra Fleck 
//Class Section : B
//Email: afleck@andrew.cmu.edu
//Project-02

//Start values for face

//eyes
var eyeSize = 50;
var pupilSize = 20;
var pupilHeight = 20;

//face
var faceWidth = 200;
var faceHeight = 200;
var faceColor = 200;

//nose
var noseSize = 10;

//shirt
var shirtColor = 350;

//body
var bodyW = 300;
var bodyH = 350;

//mouth
var mouthSize_1 = 30;
var mouthSize_2 = 10;

//eyebrows
var eyebrowS = 60;

//hair
var hairColor = 100;

//left ear
var earWLeft = 65;
var earHLeft = 65;
//right ear
var earWRight = 65;
var earHRight = 65;

//left arm
var armWLeft = 50;
var armHLeft = 80;
var armWRight = 50;
var armHRight = 80;


 
function setup() {
    createCanvas(640, 480);
}
 
function draw() {
    background(232,195,230);
    //set basic face parameters

    //clouds
    fill (189,223,185);
    stroke('white');
    ellipse();

    fill(241,227,faceColor);
    stroke(65,66,64);
    strokeWeight(4);
    ellipse(width / 2, height / 2, faceWidth,  faceHeight);

    //change shirt color + make body
    fill (204,191,shirtColor);
    stroke(65,66,64);
    strokeWeight(3);
    ellipse (width / 2, height / 2 + faceHeight * 0.5 + bodyH * 0.5, bodyW, bodyH);

    //body spot
    fill (204,191,162);
    stroke('white');
    strokeWeight(3);
    ellipse (width / 2, height / 2 + faceHeight * 0.5 + bodyH  * 0.5, bodyW / 2, bodyH / 2 + 80);

    

    //mouth shade
    fill(204,191,162);
    stroke(214,199,181);
    ellipse (width /2, 280, 100,100);

    //set left + right eye values
    fill ('white');
    stroke('white');
    var eyeLX = width / 2 - faceWidth * 0.25;
    var eyeRX = width / 2 + faceWidth * 0.25;
    ellipse(eyeLX, height / 2, eyeSize, eyeSize);
    ellipse(eyeRX, height / 2, eyeSize, eyeSize);

    //eye pupil values
    fill ('black');
    noStroke();
    var eyeLP = width / 2 - faceWidth * 0.25;
    var eyeRP = width / 2 + faceWidth * 0.25;
    ellipse(eyeLP, height / 2, pupilSize, pupilHeight);
    ellipse(eyeRP, height / 2, pupilSize, pupilHeight);

    //eyebrows
    noFill();
    stroke('brown');
    strokeWeight(5);
    // arc(x, y, w, h, start, stop, [model])
    arc(eyeLX, height / 2, eyebrowS, eyebrowS, PI + QUARTER_PI, TWO_PI - QUARTER_PI);
    arc(eyeRX, height / 2, eyebrowS, eyebrowS, PI + QUARTER_PI, TWO_PI - QUARTER_PI);

    //mouth
    fill ('red');
    stroke(228,140,226);
    ellipse(width / 2, 280, mouthSize_1, mouthSize_2);

    //nose
    fill ('brown');
    noStroke();
    ellipse(width / 2, height / 2 + 20, 20,10);

    //ears
    //left ear
    fill (143,123,77);
    stroke('white');
    ellipse(width / 2 + faceWidth * 0.20 + earWLeft, height / 2 -80, earWLeft, earHLeft);

    //right ear
    fill (143,123,77);
    stroke('white');
    ellipse(width / 2 - faceWidth * 0.20 - earWRight, height / 2 -80, earWRight, earHRight);


    //left paw
    fill (143,123,77);
    stroke('black');
    ellipse(width / 2 - bodyW * 0.20 - armWRight -10, height / 2 + 230, armWRight+50, armHRight);

    //right paw
    fill (143,123,77);
    stroke('black');
    ellipse(width / 2 - bodyW * 0.20 + armWRight + 120, height / 2 + 230, armWRight+50, armHRight);
    

}
 
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(200, 300);
    faceHeight = random(200, 400);
    eyeSize = random(10, 50);
    pupilSize = random(5, 15);
    pupilHeight = random(1,20);
    bodyW = random(100,300);
    shirtColor = random(100,500);
    faceColor = random(150,250);
    mouthSize_1 = random(30, 50);
    mouthSize_2 = random(10,30);
    eyebrowS = random(20,80);

    //variable ear sizes
    

}

For this project I just wanted to rely on simple shapes that move together. Since one rudimentary shape is a circle, I ended up making a bear. Next time when I approach a project such as this, I will want to make sure that all components stay flush with one another, despite the random variable change of their sizes.

Project-02-Variable-Face-Veronica

sketch


/*
Veronica Wang
Section B
yiruiw@andrew.cmu.edu
Project-02
*/

var eyeSize = 20;
var faceWidth = 100;
var faceHeight = 150;
var ColorR = 255;
var ColorG = 255;
var ColorB = 255;
var smileY = 200;
var gray = 50;

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

}

function draw() {
    background(255, 179, 48);

    //face
    noStroke();
    fill(120, 80, ColorB);
    ellipse(width / 2 - faceWidth / 2 + 25, height / 2 - faceHeight / 2 + 25, faceWidth * 0.5,  faceWidth * 0.5);
    ellipse(width / 2 + faceWidth / 2 - 25, height / 2 - faceHeight / 2 + 25, faceWidth * 0.5,  faceWidth * 0.5);
    fill('white');
    ellipse(width / 2 - faceWidth / 2 + 25, height / 2 - faceHeight / 2 + 25, faceWidth * 0.3,  faceWidth * 0.3);
    ellipse(width / 2 + faceWidth / 2 - 25, height / 2 - faceHeight / 2 + 25, faceWidth * 0.3,  faceWidth * 0.3);
    fill(120, 80, ColorB);
    ellipse(width / 2, height / 2, faceWidth,  faceHeight);

    //body
    fill(120, 80, ColorB);
    ellipse(width / 2, height - 90, faceWidth * 2, height - faceHeight);
    fill('white');
    ellipse(width / 2, height - 90, faceWidth * 1.5, height - faceHeight * 2);

    //eyes
    var eyeLX = width / 2 - faceWidth * 0.25;
    var eyeRX = width / 2 + faceWidth * 0.25;
    fill(gray);
    ellipse(eyeLX, height / 2, eyeSize, eyeSize);
    ellipse(eyeRX, height / 2, eyeSize, eyeSize);

    //nose
    fill('black');
    ellipse(width / 2, height / 2 + 10, faceWidth / 5,  faceHeight / 8);

    //mouth
    var dist = height / 2 + smileY;
    noFill();
    stroke(255, 205, 0);
    strokeWeight(5);
    curve(eyeLX, height/2, eyeLX + 20, dist, eyeRX - 20, dist, eyeRX, height/2);
    
}

function mousePressed() {
    faceWidth = random(120, 180);
    faceHeight = random(120, 180);
    eyeSize = random(10, 20);
    ColorR = random(150, 220);
    ColorG = random(150, 220);
    ColorB = random(0, 100);
    smileY = random(faceHeight / 5, faceHeight / 3);
    gray = random(100, 255);
}

Initially I wanted to recreate Miyazaki’s Totoro, but it just started to look more and more like a bear so…it’s a bear now. I enjoyed working on this project and especially trying to figure out which/how geometries should be related. Some of the variables include body color/size, eye color/size, head size, ear size, etc.

Romi Jin – Project-02-Variable-Face-Section B

sketch

/*Romi Jin
Section B
rsjin@andrew.cmu.edu
Assignment-02-A
*/

var earWidth = 50
var earLength = 150
var earX = 150
var earY = 200

var faceWidth = 225
var faceX = 225
var faceY = 340

var eyeWidth = 35
var eyeX = 180
var eyeY = 350
var eyeColorR = 0
var eyeColorG = 0
var eyeColorB = 0

var noseWidth = 30
var noseLength = 15
var noseX = 225
var noseY = 385

var word = 0
var wordNumber = 0


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

function draw() {
    background(245,215,215);

    //left ear
    noStroke();
    fill(255);
    ellipse(earX,earY,earWidth,earLength);

    noStroke();
    fill(253, 229, 255);
    ellipse(earX,earY+25,earWidth/2,earLength/2);

    //right ear
    noStroke();
    fill(255);
    ellipse(2*earX,earY,earWidth,earLength);

    noStroke();
    fill(253, 229, 255);
    ellipse(2*earX,earY+25,earWidth/2,earLength/2);

    //face
    noStroke();
    fill(255);
    ellipse(faceX,faceY,faceWidth,faceWidth);

    //left eye
    noStroke();
    fill(eyeColorR,eyeColorG,eyeColorB);
    ellipse(eyeX,eyeY,eyeWidth,eyeWidth);

    //right eye
    noStroke();
    fill(eyeColorR,eyeColorG,eyeColorB);
    ellipse(eyeX+85,eyeY,eyeWidth,eyeWidth);

    //nose
    noStroke();
    fill(0);
    ellipse(noseX,noseY,noseWidth,noseLength);

    //text
    var word = int(wordNumber);
    if (word == 1) {
        noStroke();
        textSize(20);
        fill(0);
        text("bunny", 205, 500);


    } else if (word == 2){
        noStroke();
        textSize(20);
        fill(0);
        text("rabbit", 205, 500);

    } else if (word == 3){
        noStroke();
        textSize(20);
        fill(0);
        text("bun", 215, 500);

    } else {
        noStroke();
        textSize(20);
        fill(0);
        text(":)", 225, 500);
    }
}



function mousePressed() {

    earWidth = random(40, 75);
    earLength = random(140,200);

   	eyeColorR = random(0,255);
   	eyeColorG = random(0,255);
   	eyeColor = random(0,255);

   	noseWidth = random(25,40);
   	noseLength = random(10,20);

   	word = random(0,4);
   	wordNumber = random(0,4);

 }

This was a very fun project and a great introduction to variables! Since we had already coded a human face for the previous project, I wanted to do something different this time and created a simple drawing of an animal. (a bunny – my favorite!) It took a lot less time than expected!

Shirley Chen-Project-02-Variable-Face

sketch

// Shirley Chen
// Section B
// junfanc@andrew.cmu.edu
// Project-02

var headWidth = 230;
var headHeight = 230;
var eyeSize = 50;
var diff = 1;
var refSize = 0.2;
var angle = 0;
var blushWidth = 40;
var blushHeight = 20;
var color = 139;
var color2 = 98;

function setup() {
    createCanvas(640, 480);
    angleMode = "degree"
}


function draw() {
	background(239, 163, 163);
	fill(255);
	noStroke();
//head
	ellipse(300, 280, headWidth, headHeight);

//ear1
	stroke(183, 105, 105);
	translate(40, 5);
	rotate(angle);
	beginShape();
	curveVertex(220, 200);
	curveVertex(220, 200);
	curveVertex(170, 100);
	curveVertex(200, 100);
	curveVertex(250, 200);
	curveVertex(250, 200);
	endShape();

// //ear2
	beginShape();
	curveVertex(300, 200);
	curveVertex(300, 200);
	curveVertex(340, 100);
	curveVertex(370, 100);
	curveVertex(340, 200);
	curveVertex(340, 200);
	endShape();
	noStroke();
	fill(244, 212, 212);
	beginShape();
	curveVertex(310, 200);
	curveVertex(310, 200);
	curveVertex(330, 150);
	curveVertex(340, 150);
	curveVertex(330, 200);
	curveVertex(330, 200);
	endShape();
	beginShape();
	curveVertex(230, 200);
	curveVertex(230, 200);
	curveVertex(215, 170);
	curveVertex(225, 170);
	curveVertex(240, 200);
	curveVertex(240, 200);
	endShape();

//bowknot
	fill(247, 211, color);
	beginShape();
	curveVertex(240, 210);
	curveVertex(240, 210);
	curveVertex(260, 150);
	curveVertex(280, 150);
	curveVertex(300, 200);
	curveVertex(300, 200);
	endShape();
	beginShape();
	curveVertex(170, 240);
	curveVertex(170, 240);
	curveVertex(170, 180);
	curveVertex(190, 180);
	curveVertex(240, 210);
	curveVertex(240, 210);
	endShape();
	fill(244, 160, 98);
	ellipse(235, 205, 20, 20);

//eyes
	fill(0);
	ellipse(250, 280, eyeSize * diff, eyeSize * diff);
	ellipse(350, 280, eyeSize * diff, eyeSize * diff);
	fill(255);
	ellipse(250 + diff, 280, eyeSize * refSize, eyeSize * refSize);
	ellipse(350 + diff, 280, eyeSize * refSize, eyeSize * refSize);
	ellipse(260 + diff, 280, eyeSize * refSize, eyeSize * refSize + 5);
	ellipse(360 + diff, 280, eyeSize * refSize, eyeSize * refSize + 5);

//nose
	fill(225, 105, 105);
	triangle(290, 300, 310, 300, 300, 310);

//mouth
	fill(242, 85, 85);
	ellipse(300, 330, 30, 30);
	stroke(196, 138, 138);
	strokeWeight(4);
	fill(255);
	beginShape();
	curveVertex(260, 320);
	curveVertex(260, 320);
	curveVertex(270, 330);
	curveVertex(290, 330);
	curveVertex(300, 310);
	curveVertex(300, 310);
	endShape()
	beginShape();
	curveVertex(300, 310);
	curveVertex(300, 310);
	curveVertex(310, 330);
	curveVertex(330, 330);
	curveVertex(340, 320);
	curveVertex(340, 320);
	endShape()

//blush
	fill(244, 212, 212);
	noStroke();
	ellipse(230, 330, blushWidth, blushHeight);
	ellipse(370, 330, blushWidth, blushHeight);
}

//mouse pressed
function mousePressed() {
    headWidth = random(220, 250);
    headHeight = random(220, 250);
    eyeSize = random(35, 40);
    diff = random(1, 2);
    refSize = random(0.2, 0.4);
    angle = random(0, 0.2);
    blushWidth = random(30, 40);
    blushHeight = random(20, 40);
    color = random(139, 255);
}



For this project, I drew a rabbit face with variation of ears, eyes, blush, and the bow knot. For the ears, I rotate them at various angles, and I also keep the eyes and bow knot moving with the ears so the proportion looks correct. The eye size changes randomly with the reflection in the eyes. The bow knot’s color also change randomly. The blush size also changes, too. I enjoyed this project, it was fun! 🙂

Daniel Teague – Looking Outward 02

These shoe soles by Nervous Systems really interests me. I was a member of the Cross Country and Track teams in High School, so running equipment, such as a shoe and the design of its soles, are more interesting to me than for most people. This is especially interesting because it’s generating a sole to fit a person’s feet and running gait, or running pattern. This makes each shoe unique to that person.

KadeStewart-Project02-VariableFaces

sketch

//Kade Stewart
//Section B 9:30
//kades@andrew.cmu.edu
//Assignment-02-B

//randomized variables
var facewidth = 10;
var faceheight = 10;
var eyex = 5;
var eyey = 5;
var eyewidth = 5;
var eyeheight = 5;
var pupilsize = 5;
var r = 0;
var g = 0;
var b = 0;
var fr = 30;
var mouthsize = 0;
var mouthx = 0;
var mouthy = 0;
var hat = -1;
var mouth = -1;
var frame = 0;

//non-randomized variables
var ang = 0;
var ang2 = 0;


function setup() {
    var height = 400;
    var width = 400;
    createCanvas(width, height);

    rectMode(CENTER);
    noStroke();
}

function mousePressed() {
	fr = 30;
	//reset the animation variables
	ang = 0;
	ang2 = 0;
}

function draw() {
	//reduces the frames to slowly stop "loading screen"
	if (fr > 0) {
		fr--;
		frameRate(fr);
		hat = -1;
		mouth = -1;
	}

	//only redraw new face if the mouse has been clicked recently
	if (fr > 0) {
		//"reset" the page
		noStroke();
		fill(170,180,210);
    	rect(width/2, height/2, width, height, 20);

		//randomize face, eyes, mouth
	    facewidth = random(150,250);
	    faceheight = random(150,250);
	    r = random(200, 225);
	    g = random(200, 225);
	    b = random(200, 225);

	    eyewidth = random(25, 35);
	    eyeheight = random(25, 35);
	    eyex = random(5, 35);
	    eyey = random(-35, 35);
	    pupilsize = random(10, 12);

	    
	    if (mouth < 1) {
	    	mouthsize = random(10, 20);
	    	mouthx = random(width/2 - facewidth/4, width/2);
	    	mouthy = random(height/2 + eyeheight/2 + eyey + 5, height/2 + faceheight/4);
	    }
	    if (mouth >= 1) {
	    	mouthsize = random(10, 20);
	    	mouthx = random(width/2, width/2 + facewidth/4);
	    	mouthy = random(height/2 + eyeheight/2 + eyey + 5, height/2 + faceheight/4);
	    }


	    //draw head
	    fill(r, g, b);
	    rect(width/2, height/2, facewidth, faceheight, faceheight/5);

	    //eyes
	    fill(255);
	    rect(width/2 - 15 - eyex, height/2 - 20 + eyey, eyewidth, eyeheight, 15);
	    rect(width/2 + 15 + eyex, height/2 - 20 + eyey, eyewidth, eyeheight, 15);
	    fill(0);
	    rect(width/2 - 15 - eyex, height/2 - 20 + eyey, pupilsize, pupilsize, 5);
	    rect(width/2 + 15 + eyex, height/2 - 20 + eyey, pupilsize, pupilsize, 5);

	}



	//ending animation
	if (fr == 0) {
		//restore the frame rate
		frameRate(30);
		frame++;

		//create the yellow lines
		noFill();
		stroke(253, 253, 150);
		strokeWeight(4);
		for (i = 1; i <= 16; i++) {
			line(width/2 + (ang * cos(2 * PI * (i/16))), 
				 height/2 + (ang * sin(2 * PI * (i/16))),
				 width/2, height/2);
		}
		
		//speed for the lines in the animation
		if (ang > -width) {
			ang -= 12;
		}

		noStroke();
		fill(170,180,210);
		rect(width/2, height/2 + faceheight/2 + 30, 250, 40, 10);
		if (frame >= 10) {
			fill(255);
			textAlign(CENTER);
			textStyle(BOLD);
			textSize(32);
			text("It's party time!!", width/2, height/2 + faceheight/2 + 40);
		}
		if (frame == 18) {
			frame = 0;
		}

		//start to delete the lines when the lines are drawn
		if (ang <= -width) {
			//circle that covers/"deletes" the lines
			noStroke();
			fill(170,180,210);
    		ellipse(width/2, height/2, 2*ang2, 2*ang2);

    		//deletion speed
			if (ang2 > -width*(2/3)) {
				ang2 -= 8;
			}
		}

		noStroke();

		//make the background nice after the animation
		if (ang2 <= -width * (2/3)){
			background(255);
			fill(170,180,210);
    		rect(width/2, height/2, width, height, 20);
		}

		//draw head
	    fill(r, g, b);
	    rect(width/2, height/2, facewidth, faceheight, faceheight/5);

	    //eyes
	    fill(255);
	    rect(width/2 - 15 - eyex, height/2 - 20 + eyey, eyewidth, eyeheight, 15);
	    rect(width/2 + 15 + eyex, height/2 - 20 + eyey, eyewidth, eyeheight, 15);
	    fill(0);
	    rect(width/2 - 15 - eyex, height/2 - 20 + eyey, pupilsize, pupilsize, 5);
	    rect(width/2 + 15 + eyex, height/2 - 20 + eyey, pupilsize, pupilsize, 5);

	    if (ang2 <= -width/2) {
	    	//randomizes the side the hat & mouth are on
	    	if (hat == -1) {
	    		hat = random(0, 2);
	    	}
	    	if (mouth == -1) {
	    		mouth = random(0,2);
	    	}

	    	//makes sure the mouth isn't too far down
	    	if (mouthy + mouthsize/2 > height/2 + faceheight/2) {
		    		mouthy = height/2 + faceheight/2 - mouthsize/2 - 5;
		    }

		    //draw party hat
	    	if (hat >= 1) {
	    		fill("red");
	    		triangle(width/2 + facewidth/2 - faceheight/5, height/2 - faceheight/2,
		    		 width/2 + facewidth/2, height/2 - faceheight/2 + faceheight/5,
		    		 width/2 + facewidth/2 + 20, height/2 - faceheight/2 - 20);
	    		fill("yellow");
		    	ellipse(width/2 + facewidth/2 + 20, height/2 - faceheight/2 - 20, 25);

	    	} else {
	    		fill("red");
	    		triangle(width/2 - facewidth/2 + faceheight/5, height/2 - faceheight/2,
		    		 width/2 - facewidth/2, height/2 - faceheight/2 + faceheight/5,
		    		 width/2 - facewidth/2 - 20, height/2 - faceheight/2 - 20);
	    		fill("yellow");
		    	ellipse(width/2 - facewidth/2 - 20, height/2 - faceheight/2 - 20, 25);

	    	}

	    	//draw mouth on left side of face
	    	if (mouth < 1) {
	    		fill(25);
		    	rect(mouthx, mouthy, mouthsize, mouthsize, 
		    		 mouthsize/5, mouthsize/5, mouthsize/2, mouthsize/5);

	    	} else {
	    		//draw mouth on right side of face
				fill(25);
		    	rect(mouthx, mouthy, mouthsize, mouthsize, 
		    		 mouthsize/5, mouthsize/5, mouthsize/5, mouthsize/2);
	    	}

	    }
	    
	}
	

    
}

In the beginning, I knew that I wanted to add an interesting transition because randomization makes transitions look cool. After I finished the transition, I realized that my project had an overall happy feel. I added a party hat and text to make sure that the user knew that they were supposed to be having a fun time with all the faces they generated.

Alessandra Fleck – Looking Outwards – 02

I find the project, Unnumbered Sparks ,presented at TED2014, by Aaron Koblin particularly inspiring because it takes what is one of the most prominent, yet unseen movements in the modern day, and projects it onto a visual depiction that fills the sky when looked upon from below. Stretching 745 feet across, this piece blanketing above ground takes in cell phone signals to draw and play with the color mapping details being projected onto it. Utilizing the Javascript interactive rendering API called WebGL, the user’s motion is able to come to life as it is rendered through shaders and javascript. To get the drawings/movement-associated art projected onto the “blanket,” websockets pass the data from a mobile to rendering browser. Just as the work flows along the lines of bringing a community together, it also does so in a similar language in the way the algorithms utilized connect to one another. What makes this work so interesting is that it is a piece of art that inspires those who are viewing the sculpture to also engage in art. In other words, an art piece that leaves room to branch out and become even more elaborate with the viewers art included into the piece. As a common theme of technological developments today is about sharing information across a larger span, it is neat to see such theme come out in a semi tangible application.