// Yoshi Torralva
// Section E
// yrt@andrew.cmu.edu
// Project 04
function setup() {
createCanvas(300, 400);
}
function draw() {
background(0, 191, 255);
/* for loop making 40 lines
which allows for 10px spacing */
for(var i = 0; i < 40; i++) {
/* mouseX and Mouse Y move the string art */
strokeWeight(1);
stroke(255);
//moving string art
line(mouseX, i * 10, 0 + i * 10, mouseY);
// flipped mouseX and mouse Y to create opposite scaling
line(mouseY, i * 10, 0 + i * 10, mouseX);
strokeWeight(0.2);
//string art starting at top x height
// 10 px width between each line
// increments of 50
line(i * 10, 0, 300, 0 + i * 10);
line(i * 10, 0, 250, 0 + i * 10);
line(i * 10, 0, 200, 0 + i * 10);
line(i * 10, 0, 150, 0 + i * 10);
line(i * 10, 0, 100, 0 + i * 10);
line(i * 10, 0, 50, 0 + i * 10);
//string art at bottom x height
// 10 px width between each line
// increments of 50
line(250, i * 10, 0 + i * 10, 400);
line(200, i * 10, 0 + i * 10, 400);
line(150, i * 10, 0 + i * 10, 400);
line(100, i * 10, 0 + i * 10, 400);
line(50, i * 10, 0 + i * 10, 400);
}
}
Using string art, I wanted to create a shell-like formation. I used multiple lines in the for() statement to create a swirling visual. Mouse tracking was implemented to add depth as it served as a frame into the shell.