Jina Lee – Project 04

For this project, I played around with curves. I wanted to give a disco/chaotic vibe. When move your mouse around the canvas, the lines move making it seem more busy. I enjoyed this project because there were so many ways I could make my strings move. In the future, I want to add more curves to make it seem like a camera lens opening and closing with the string curve. This assignment helped me better understand how loops work and how I can manipulate curves with mouseX and mouseY.

sketch

//Jina Lee
//Section E
//jinal2@andrew.cmu.edu
//Project-04

function setup() {
    createCanvas(300, 400);
}

function draw() {
    //background is random
    red = random(255);
    green = random(255);
    blue = random(255);
    background(red, green, blue, 40);

    //lines that just go up and down
    //as the mouse goes right the lines appear
    for (var i = 0; i <= mouseX; i += 50) {
        stroke(255);
      	strokeWeight(1);
      	line(i, 0, i, height + i);
    }
	  //top left corner and bottom right
    //it curves down
	  for (var a = 0; a < mouseX; a += 20) {
	      stroke(255);
		    strokeWeight(1);
		    line(a, 0, width, a);
	  }
    //top right and left bottom
	  for (var b = 0; b < mouseY; b += 5) {
		    stroke(255);
		    strokeWeight(1);
		    line(width + b, b, width - b, height);
    }
	  //left top and bottom right
	  for (var c = 0; c < mouseX; c += 20) {
		    stroke(255);
		    strokeWeight(1);
		    line(width - c, height, 0, height - c);
    }
	  //left bottom and top right
	  for (var d = 0; d < mouseY; d += 5) {
		    stroke(255);
		    strokeWeight(1);
		    line(0, height - d, d, 0);
    }
}

Leave a Reply