atraylor – Project 05 – Section B

sketch

// atraylor
// Section B
// Project 05


function setup() {
    createCanvas(480, 480);
    background(13, 150, 255);
}

function draw() {

    moreThings(); // yellow spots



    var move = 8; // the amount move in x per line segment
    var lastX = -1; // beginning values
    var lastY = -1;
    var y = 1;
    var borderX = 0; // translates to edge
    var borderY = -1;
    stroke(127, 199, 255);

    for(var moveY = 0; moveY < 1000; moveY += 10){ // lines in the background
        for(var x = borderX; x <= width-borderX; x+= move){
            y = moveY + borderY + random(1, 20);

            line(x, y, lastX, lastY);

            lastX = x; //place the "new" x y values into last
            lastY = y;
        }
    }
    noLoop();
    things();//orange and purple circles
    noLoop();


}

function things(x, y){ //orange and purple circles
    for(var y = 0; y < width; y+= 100){
        for(var x = 0; x < height; x+= 100){
            var n = random(1, 5);
            var m = random(-5, 5);
            stroke(255, 183, 87);
            fill(255, 146, 0);
            ellipse(40 + x + n, 40 + y + n, 40, 40);
            stroke(108, 108, 244);
            noFill();
            strokeWeight(5);
            ellipse(41 + x + m, 48 + y + m, 40 + m, 40 + m);
        }
    }
}

function moreThings(x, y){ // yellow spots
    for(var y = 0; y < height; y += 100){
        for(var x = 0; x < width; x += 100){
            var n = random(1, 5);
            noStroke();
            fill(255, 230, 154);
            ellipse(x + n, y + n, 10, 10);
        }
    }
}

 

For this project, I wanted to practice making noisy lines. I used a for loop that drew sections of the line, using previous coordinates as starting points. Then I added another loop that translates the y coordinates of the line through each iteration. An improvement that I would make would be to remove the connecting lines between the rows. The result of the loop looked like primitive waves or mountains to me. I decided to pursue this concept by using bright and sunny colors. I don’t think I would wear this pattern, but it gave me a chance to try something new.

Leave a Reply