Sheenu-Project 04-String Art

sketch

//Sheenu You
//Section E
//Project-04
//sheenuy@andrew.cmu.edu
function setup() {
    createCanvas(400, 300);
    strokeWeight(2);
}

function draw() {
	background(0);
	for (var i = 20; i <400; i+= 20) {
		stroke("yellow");
		line(0,i,i*mouseX/5,400);
		line(400,i,i*mouseX/5,0);
	}
	for (var b = 10; b<600; b+=5){
		strokeWeight(1);
		stroke("red");
		line(0+b,0,0+b,300);
	}
for (var a = 20; a <400; a+= 10) {
		stroke("blue");
		line(0,a,a,400);
		line(400,a,a,0);
	}
}

This is a very simple line art I made using the for function. The for function is something I still don’t understand very well. I see many possibilities in this function but learning this is a bit of a challenge that needs extra time. Other than that, I really enjoyed how my project turned out in the end. The MouseX really makes this thing come to life.

Author: Sheenu You

Choo choo

Leave a Reply