karinac-Project-04

karinac-Project-04

//Karina Chiu
//Section C
//karinac@andrew.cmu.edu
//Project-04

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

function draw() {
    //points of triangle
    var x1 = width/3;
    var y1 = height/3;
    var x2 = width/3;
    var y2 = height-(height/3);
    var x3 = width-(width/3);
    var y3 = height/3;
    var x4 = width-(width/3);
    var y4 = height-(height/3);

    stroke(255,100,0);
    strokeWeight(2);
    rectMode(CENTER);
    fill(250,200,0);
    rect(width/2,height/2,width/3,height/3);


    for (var i = 0; i < 50; i +=2) {
        strokeWeight(0.2);

        //lines outside square
        line(x1, y1, 1, i*10);
        line(x1, y1, i*10, 1);
        line(x2, y2, 1, height-i*10);
        line(x2, y2, i*10, height-1);
        line(x3, y3, width-i*10, 1);
        line(x3, y3, width-1, i*10);
        line(x4, x4, width-1, height-i*10);
        line(x4, x4, width-i*10, height-1);
    }

}

At first, I did not know how I wanted this project to look. I just played around with the loop function to draw lines until I came across a design that I could branch off of. I implemented this design that is based off of the concept of light, which includes the source of light in the middle and the rays that come from it. The most difficult part for me was definitely coming up with a design that was proud to create. After that process was over and I could see a clear picture of what I wanted to draw, the rest was straightforward.

Leave a Reply