Jenna Kim (Jeeyoon Kim)- Project 4- String Art

jennakim04

/* Jenna Kim (Jeeyoon Kim)
Section E
jeeyoonk@andrew.cmu.edu
Project 04
*/

function setup() {
    createCanvas(400, 300);
    var fishX;
	var fishY;
	var fishH;
	var fishW;
}

function draw() {
	background(100,149,237);
	fishX = 150;
    fishY = 140;
    fishH = 50;
    fishW = 100;

    noStroke(0);
    fill(100, 200, 300); //tail
    triangle(fishX + fishW - 10, fishY, fishX + fishW + 50, fishY - 30, fishX + fishW + 50, fishY + 30); 
    fill(102, 196, 184) // body of the fish
    ellipse(fishX + fishW / 2, fishY, fishW, fishH); 
    fill(0); //eye
    ellipse(fishW * 1 / 5 + fishX, fishY - 10, 10, 10);

	var x1 = 1;
	var x2 = 10;
	var x3 = 0;
	var x4 = 40;
	var y1 = 1;
	var y2 = 3;
	var y3 = 30;
	var y4 = 80;

	// bottom LEFT
	for (var i = 0; i < width / 3; i ++){
		x1 += 30;
		y1 += 10;
		strokeWeight(1);
		stroke(10, 100, 132 );
		fill(0, 0, 0);
		line(i, y1, x1, height);

		x1 += 1;
		y1 += 3;
	}
	// top RIGHT
	for (var a = 0; a < width / 3; a ++){
		x2 += 10;
		y2 += 10;
		strokeWeight(1);
		stroke(255, 0, 0);
		line(width - a, y2 , x2, 1);

		x2 += 6;
		y2 += 5;
	}
	// top LEFT
	for (var b  = 0; b < height / 2; b ++){
		x3 += 15;
		y3 += 5;
		strokeWeight(1);
		stroke(255, 255, 255);
		line(b, height - y3, x3, 1);

		x3 += 6;
		y3 += 5;
	}
	// bottom RIGHT (SHIP LIGHT***)
	for (var f  = 0; f < height / 2; f ++){
		x4 += 5;
		y4 += 30;
		strokeWeight(1);
		stroke(255, 255, 0);
		line(f, height, x4, y4);

		x4 -= 1;
		y4 -= 30;
	}
	textSize(15);
	fill(250, 250, 250);
	text('quiz fishy', 170, 180)
	
}

Through this project, I learned how each variable works with each other to create curves. I know learning about the string art will be very useful for future media art projects (like the ones from Lunar Gala last year).

Leave a Reply