xxxxxxxxxx
177
/* Ruoyun Dai
Partner: Joy Kim
Description:
Seven years ago, I lost my necklace that I had cherished so much. The necklace is composed of a 18K yellow gold chain and a little butterfly pendant charm. The butterfly charm is not a solid chunk of gold but a flat sculpture with delicate cutouts like a net. Its wings are made of beautifully curved lines which constitute a butterfly shape on the whole. The chain is a ball chain. The size of the ball is small. If I might be extremely fortunate to find the necklace, I would wear it everyday and run around here and there so that the butterfly can literally fly.
*/
function setup() {
createCanvas(400, 400);
angleMode(DEGREES)
}
function draw() {
background(7, 90, 99); //BG Color
translate(width/2, height/2);
// Ball Chain
noFill();
strokeWeight(2)
stroke(144, 118, 68);//Boundary Color
curve(-100, -60, -200, -200, 0, -25, 100, -100);
curve(-100, -60, 0, -25, 200, -200, 100, -100);
fill(218, 180, 107);//Gold Color
ellipseMode(CENTER);
let steps = 16;
for (let i = 0; i <= steps; i++) {
let t = i / steps;
let x = curvePoint(-100, -200, 0, 100, t);
let y = curvePoint(-60, -200, -25, -100, t);
ellipse(x, y, 10, 10);
x = curvePoint(-100, 0, 200, 100, t);
y = curvePoint(-60, -25, -200, -100, t);
ellipse(x, y, 10, 10);
}
// Big Wings
//Left
push();
noStroke();
fill(218, 180, 107);//Gold Color
rotate(30);
ellipse(-40, 30, 130, 90);
pop();
//L Detail
push();
strokeWeight(3);
stroke(144, 118, 68);//Boundary Color
fill(7, 90, 99);
rotate(30);
ellipse(-50, 30, 70, 30);
pop();
//Right
push();
noStroke();
fill(218, 180, 107);//Gold Color
rotate(-30);
ellipse(40, 30, 130, 90);
pop();
//R Detail
push();
strokeWeight(3);
stroke(144, 118, 68);//Boundary Color
fill(7, 90, 99);
rotate(-30);
ellipse(50, 30, 70, 30);
pop();
// Small Wings
//Left
push();
strokeWeight(4);
stroke(218, 180, 107);
fill(218, 180, 107);
rotate(-30);
ellipse(-52, 44, 60, 40);
pop();
//Small L Detail
push();
strokeWeight(3);
stroke(144, 118, 68);//Boundary Color
fill(7, 90, 99);
rotate(-30);
ellipse(-60, 46, 28, 15);
pop();
//Right
push();
noStroke();
fill(218, 180, 107);
rotate(30);
ellipse(52, 44, 60, 40);
pop();
//Small R Detail
push();
strokeWeight(3);
stroke(144, 118, 68);//Boundary Color
fill(7, 90, 99);
rotate(30);
ellipse(60, 46, 28, 15);
pop();
// Butterfly Joint
push();
strokeWeight(3);
stroke(144, 118, 68);//Boundary Color
fill(218, 180, 107);
rect(-10, -35, 18, 34, 3);
pop();
// Gold Reflection
//1
push();
blendMode(LIGHTEST);
translate(130, 80);
fill(242, 220, 141,50);
noStroke();
beginShape();
vertex(-10, 10);
vertex(0, 35);
vertex(10, 10);
vertex(35, 0);
vertex(10, -8);
vertex(0, -35);
vertex(-10, -8);
vertex(-35, 0);
endShape();
pop();
//2
push();
translate(-70, -100);
fill(242, 220, 141,50);
noStroke();
beginShape();
rotate(30);
vertex(-10, 10);
vertex(0, 35);
vertex(10, 10);
vertex(35, 0);
vertex(10, -8);
vertex(0, -35);
vertex(-10, -8);
vertex(-35, 0);
endShape();
pop();
//3
push();
translate(-100, 130);
fill(242, 220, 141,50);
noStroke();
beginShape();
rotate(70);
vertex(-10, 10);
vertex(0, 35);
vertex(10, 10);
vertex(35, 0);
vertex(10, -8);
vertex(0, -35);
vertex(-10, -8);
vertex(-35, 0);
endShape();
pop();
}