Project 04 – String Art

crisscrossfile
//Rachel Kim
//15-104(Section C)
//rachelki@andrew.cmu.edu
//Project-04


// x & y coordinates for lines 
var x = 0;
var y = 0;

function setup() {

//assigned canvas size
	createCanvas(600,600);
}

function draw() {

//dark blue background color
	background(3, 43, 67);

//criss-crossed lines
	for (var i = 0; i <= 50; i += 1) {
    
		//blueA lines
		stroke(155, 189, 249);
		strokeWeight(mouseX/300); //changes line thickness
		line(x, height - i*10, width - i*8, height + i);


		//blueB lines
		stroke(196, 224, 249);
		strokeWeight(mouseY/300); //changes line thickness
		line(height + i*0.5, width + i*40, x + i*10, y - i*30);

		//green lines
		stroke(178, 255, 168);
		strokeWeight(mouseX/300); //changes line thickness
		line(height - i*15, y + i/0.08, x, height - i/0.03);
        
        //yellow lines
		stroke(255, 249, 165);
		strokeWeight(mouseY/300); //changes line thickness
		line(width + i/0.05, y + i*50, x, height - i/0.07);

		//pink lines
		stroke(252, 109, 171);
		strokeWeight(mouseX/300); //changes line thickness
		line(x + i*20, height - i/20, width - i/2, height - i*20);
		
	}
	

}

/*
//blueC
stroke(79, 100, 158);
strokeWeight(1);
line(height + i*10, y + i/0.05, x, width - i/0.03);
*/

I wanted to explore the different patterns that the lines are able to create by using a crisscross technique. I also wanted to play around with the weight of the stroke of those lines as the user moves around the canvas.

Leave a Reply