//Sheenu You
//Section E
//Project-04
//sheenuy@andrew.cmu.edu
function setup() {
createCanvas(400, 300);
strokeWeight(2);
}
function draw() {
background(0);
//Line 1
for (var i = 20; i <400; i+= 20) {
stroke("yellow");
line(0,i,i*mouseX/5,400);
line(400,i,i*mouseX/5,0);
}
//Line 2
for (var b = 10; b<600; b+=5){
strokeWeight(1);
stroke("red");
line(0+b,0,0+b,300);
}
//Line 3
for (var a = 20; a <400; a+= 10) {
stroke("blue");
line(0,a,a,400);
line(400,a,a,0);
}
}
This project was a little bit tough since I had a lot of ideas and I really didn’t know which one to pick and how to actually make it happen. Some ideas were too overambitious and exceed the boundaries of my knowledge in P5. I was experimenting with lines and how variables affected them and made this discovery when I put two lines together and divided one of the lines’ X-coordinate by 2. It really reminded me of geometric 80’s art, so I picked a hot pink for the lines and a dark blue/purple for the background. The colors switch for the lines and background just to make it more interesting. I really love this and it looks like I am looking at a wave or a cylinder. It was really a great and also surprisingly simple discovery.