//Meredith Newman
//Section A
//mjnewman@andrew.cmu.edu
//Project-04-LineArt
function setup() {
createCanvas(400, 300);
background(135, 12, 3);
}
function draw() {
//variables used to vary spacing inbetween lines
//for lines going from the top of canvas to right
var x1StepSize = 10;
var y1StepSize = 15;
//for lines going from the right of the canvas to the bottom
var x2StepSize = 24;
var y2StepSize = 16;
//for lines going from the bottom to the left of the canvas
var x3StepSize = 22;
var y3StepSize = 12;
//for lines going from the left to the top
var x4StepSize = 11;
var y4StepSize = 12;
for (var spacing = 0; spacing < 30; spacing ++) {
//as mouse moves across width of canvas, grayscale changes
stroke(map(mouseX, 0, width, 0, 255));
//equation for lines that go from top to right of canvas
line(x1StepSize * spacing, 0, width, y1StepSize * spacing);
//equation for lines that go from right to the bottom
line(width, y2StepSize * spacing, (x1StepSize * -spacing) + width / 2, height);
//equation for lines that go from bottom to the left
line(x3StepSize * spacing, height, 0, y3StepSize * spacing);
//equation for lines that go from left to the top
line(0, (y4StepSize * spacing) + width / 2, (x4StepSize * -spacing) + width, 0);
};
}
After creating three of the “curves,” my code started to remind me of the opening credits by Saul Bass for Vertigo. So, I tried to place the fourth set of lines so that the curve echoed the eye that is synonymous with the Vertigo opening sequence. In addition, I set the background a darker red that also echoes the opening sequence. The sequence is embedded below: