Shannon Case- Project 09

For my project I chose to do a portrait of my roommate sticking her tongue out. I used triangles to represent her because this is her favorite shape and we both agreed that the aesthetic of this is better because its more varied than ellipses and rectangles or lines. As the project evolves it fills in to reveal the picture.  sketch

var underlyingImage;

function preload() {
    var myImageURL = "http://i.imgur.com/TPZ3heW.jpg";
    underlyingImage = loadImage(myImageURL);
}

function setup() {
    createCanvas(500, 500);
    background(0);
    underlyingImage.loadPixels();
}

function draw() {
    var px = random(width);
    var py = random(height);
    var ix = constrain(floor(px), 0, width-1);
    var iy = constrain(floor(py), 0, height-1);
    var theColorAtLocationXY = underlyingImage.get(ix, iy);
    var point2 = random(40);
    var point3 = random(60); //sets variables for the triangle points

    noStroke();
    fill(theColorAtLocationXY);
    triangle(px, py, px + point2, py + point2, px + point2/2, py +point3);
    //draws the image in varrying sizes of triangles


}

screen-shot-2016-10-28-at-7-47-18-pm

screen-shot-2016-10-28-at-7-47-25-pm

screen-shot-2016-10-28-at-7-47-09-pm

Leave a Reply