Uhh, so I tried to pore over all the curves available on mathworlds and kept on getting frustrated over my lack of understanding (math is, unsurprisingly, my weakest subject… especially when there are letters involved). I ended up modifying the example Epitrochoid code displayed in the deliverables section for week 7 to turn it into something completely unusual and unique compared to its original form. I named the function ‘Spanish Dancer’ because it reminds me of the wiggling, gyrating movements of fabric that are signature aspects of the revered Spanish Dance technique. My final product looks vaguely like the result of the sun reflecting light in a swimming pool, I suppose. I think that the final product was enhanced greatly by the inclusion of the ghosting effect, varying levels of opacity, and the rotation of one of the curves.
/* Rhea Nayyar
rnayyar@andrew.cmu.edu
Section C
Project 07-3; Curve Composition
*/
function setup() {
createCanvas(600, 600);
}
function draw() {
background(20,20,20, 30); //background with the ghosting command
push();
translate(width/2 - 30, height/2 - 30); //first curve shifted
fill(70, 10, 200, 30); //Fluorescent Indigo-ish
spanishDancer(); // my curve function name
pop();
push();
translate(width/2, height/2); //Second Curve Shifted
rotate(20); //Tilt!
fill(50, 160, 220, 20); //Somewhat greenish. Like a transluscent teal.
spanishDancer(); //Second curve function called
pop();
push();
translate(width/2 + 30, height/2 + 30); //Third curve shifted
fill(100, 100, 220, 60); //It's kind of like a more intense version of periwinkle?
spanishDancer(); //third curve function called
pop();
}
function spanishDancer(a, x, y) { //my curve
var x;
var y;
var a = 80.0; //starts off with the same parameters as that example epitrochoid function on the deliverables page
var b = a / 2.0;
var h = constrain(mouseY / 15.0, 0, b);
var ph = mouseX / 20.0;
noStroke();
beginShape(); //but then it gets wacked out by me playing with the parameters
for (var i = 0; i < 100; i++) {
var t = map(i, 0, 100, 0, TWO_PI);
x = (a + b) * cos(t/2) - h * cos(ph + t*2 * (a + b) / b);
y = (a + b) * sin(t*2) - h * sin(ph + t/2 * (a + b) / b);
vertex(x,y);
//lots of guessing and checking led to this happy, aesthetic accident. :)
}
endShape(CLOSE);
}