//Shariwa Sharada
//Section-A
//ssharada@andrew.cmu.edu
//Project-04
var gap = 1; //spacing between lines
var x1 = 0; //starting point x
var x2 = 200; //mid-point x
var x3 = 400 //endpoint x
var y1 = 150; //midpoint y
var y2 = 0; //starting point y
var y3 = 300; //end point y
function setup(){
createCanvas(400,300);
strokeWeight(1); //predetermining the stroke weights of everything
}
function draw(){
background(255, 247, 213);
gap = map(mouseY, 0, 300, 3, 10);//mapping the gap size so that it is proportionate no matter the placement of the mouse
var g = 150; //changing the green value
var b = 100; //changing the blue value
var r = 50; //changing the red value
for (var i= 0; i< width; i++){
//creating the first pair of dark green to yellow curves
stroke(r,g,0);
line (x1, gap*i, gap*i, y1);//creating lines based of the start and mid points
line (x2, gap*i, gap*i, y2);
g += i/20; //creating a gradation in the colour range in terms of the increment
r += i/10;
//creating the second pair of yellow to dark green curves
stroke(r,g,0);
line (gap*i, height-y1, width-x1, gap*i); //creating lines based of the end and mid points
line (gap*i, height-y2, width-x2, gap*i);
g += i/2;//creating a gradation in the colour range in terms of the increment
r += i/4;
}
//creating the third pair of green to blue curves
for (var j= 0; j< width; j++){
stroke(0,g,b);
line (x3, gap*j, gap*j, y1); //creating lines based of the end and mid points
line (x1, gap*j, gap*j, y3);
g += j/20; //creating a gradation in the colour range in terms of the increment
b += j;
}
}
The main aim of my work was to examine the difference between larger increments and smaller increments while trying to vanish some lines into the background and keeping focus on a few of them. I wanted to explore this idea because I found it fascinating how the lines when they come together form this dense intrinsic pattern of curves that you could never imagine that they could come from straight lines – but as you drag the mouse away, you realise what actually creates the lines and it makes you wonder about the complexity of everyday simple objects like curves