cchau1 – Project04 – String Art


var spaceX = 2;
var spaceY = 10;
var x1 = 30;
var y1 = 300;
var x2 = 400;
var y2 = 200;

function setup(){
	createCanvas(400, 300);
	background(80,50,255); //different background color to set the mood

function draw() {

	for(var i = 0; i < height; i ++){
		stroke(244,25,0); //red sunrays
    stroke(240,203,10); //yellow sunrays
	} //additional numbers were manipulated to fit the canvas size

    for (var k = 0; k < height; k ++) {
      stroke(255); //white space in top right corner; "cloudscape"

    for (var j = 0; j < height; j ++) { //grass
    } //the grass and cloudscape are related in increments (reflections)

    var rad = 150 //mock sun

I tried to manipulate and play around with some of the variables, as well as figure out how to coordinate with the dimensions of the canvas. I had an original idea that I eventually tossed out (which involved a sort of “playing field” using “stroke(240,203,10); line(i*30,height/-4,width,(2*height-3)/i);” in the for loop() ). I ended up deciding to manipulate straighter lines and thought that they resembled sun rays which also created a cool color-blending effect in the bottom right corner so I kept it. I made two curves that would represent “grass” and “clouds”. Personally, I like creating objects and shapes more than just mere lines becayse I am not the most familiar with loops yet (though it was fun to figure out the values) but I will probably do more projects like string art in the future!