Final Project, odh

 

odhPFinal

//Owen D Haft
//15-104 Section D
//odh@andrew.cmu.edu
//Final Project

var wristJointX = 240; //X Position of the Wrist
var wristJointY = 240; //Y Position of the Wrist
var fingerJointRadius = 5; //Radius of the hand joints
var petalSize = 9; //Radius of the Petals
var petalHeight = 0; //Position of the Petals
//List of Translations
var Texts = ["Life is Beautiful", "La Vida es Bella",
                "La Vie est Belle", "La Vita è Bella", "A Vida é Bela", 
                "Das Leben ist Wunderschoen", "Życie jest Piękne",
                "החיים יפים", "لحياة جميلة", "삶은 아름답다", "生活是美好的", 
                "人生は素晴らしい", "ज़िन्दगी गुलज़ार है", "ชีวิตช่างสวยงาม",
                "Maisha ni Mazuri", "Жизнь прекрасна", "Vita Pulchrum est"];
var THeight = 30; //Height of the Text
var TColor = 0; //Fill color of the Text

function setup() {
    createCanvas(360, 360);
    background(141, 222, 255);
}

function draw() {
    stroke(0);
    strokeWeight(1);

//Draws the Shapes of the Skeleton Hand
    //Forearm
    line(239, 241, 479, 481);
    line(241, 239, 481, 479);
    
    //Carpels
    line(wristJointX, wristJointY, 210, 210);
    line(wristJointX, wristJointY, 126, 234);
    line(wristJointX, wristJointY, 124, 236);
    line(wristJointX, wristJointY, 122, 238);
    line(wristJointX, wristJointY, 120, 240);

    //Metacarpels
    line(210, 210, 185, 195);
    line(126, 234, 110, 210);
    line(124, 236, 95, 215);
    line(122, 238, 85, 225);
    line(122, 240, 80, 235);

    line(110, 210, 135, 190);
    line(95, 215, 80, 185);
    line(85, 225, 65, 200);
    line(80, 235, 55, 220);

    //Styles the joints
    fill(0);
    strokeWeight(1);
    stroke(250);
    
    //Elbow
    ellipse()

    //Wrist Joint
    ellipse(wristJointX, wristJointY, 10);
    
    //Finger Joints
    ellipse(126, 234, fingerJointRadius);
    ellipse(124, 236, fingerJointRadius);
    ellipse(122, 238, fingerJointRadius);
    ellipse(120, 240, fingerJointRadius);

    ellipse(80, 235, fingerJointRadius);
    ellipse(85, 225, fingerJointRadius);
    ellipse(95, 215, fingerJointRadius);
    ellipse(110, 210, fingerJointRadius);
    ellipse(210, 210, fingerJointRadius);

    ellipse(55, 220, fingerJointRadius);
    ellipse(65, 200, fingerJointRadius);
    ellipse(80, 185, fingerJointRadius);
    ellipse(135, 190, fingerJointRadius);
    ellipse(185, 195, fingerJointRadius);

    //Fingertips
    strokeWeight(0); //Removes the outline on the fingertips

    triangle(178, 193, 184, 190, 165, 185);
    triangle(141, 188, 134, 183, 165, 185);
    triangle(81, 179, 75, 181, 86, 155);
    triangle(65, 194, 60, 197, 62, 172);
    triangle(52, 214, 50, 220, 40, 202);

//Flower
    //Stem
    noFill();
    strokeWeight(2); //Gives the Stem thickness
    stroke(84, 157, 26); //Stem Color
    
    curve(226, 154, 173, 156, 168, 195, 226, 191);

    //Pod
    fill(99, 47, 24);

    ellipse(177, 153, 13);

    //Petals
    fill(255, 232, 19);
    strokeWeight(0)
    stroke(0);

    //The Main text
    push();
    fill(TColor);
    textSize(30);
    text(Texts[0], 7, THeight); // Prints only "Life is Beautiful" from Texts 
    pop();

    push();
    translate(177, 153);
    for (var i = 0; i < 6; i++) { //Creates the petals of the flower
        rotate(PI/3);
        ellipse(10, petalHeight, petalSize);
            
        if (mouseIsPressed) { //Exapnds and moves the petals to
            petalHeight -= 1; //encompass the Canvas in Yellow
            petalSize += 1;   //adding a new "background" color

            if (petalSize > 500) { //Limits the growth of
                petalHeight = 500; //the petals and prompts 
                petalSize = 500;   //the Texts to be printed

                //Prints Texts with offset heights
                for (var j = 1; j < 18; j++) {
                    push();
                    translate(-180, -180);
                    fill(TColor + 255); //changes text color to white
                    textSize(16); //changes text size
                    text(Texts[j], random(10, 150), (THeight*2/3)*j+56);
                    pop(); 
                };
            };
        };
    };
    pop();

    //Draws pink petals once the yellow petals grow into the background
    if (mouseIsPressed) {
        translate(177, 153);
        for (var i = 0; i < 6; i++) {
            fill(219, 164, 164);
            rotate(PI/3);
            ellipse(10, 0, 9);
        };
    };
}

I chose to create an interactive art piece for my final project. The work features a skeleton-like hand gently holding a small flower with the words above, “Life is Beautiful”. As the viewer holds down the mouse, the petals grow and replace the background color, as new petals appear in their place. Once the growing petals completely eclipse the background, the phrase “life is beautiful” appears randomly on the screen in different languages.

I was inspired by a sketch I made earlier in the year (below) and the beautiful juxtaposition of the subjects.

Leave a Reply