xxxxxxxxxx
//wccchallenge - shadows+math
function setup() {
w = min(windowWidth, windowHeight) * 0.9;//90% of the minimum dimension is a dimension
createCanvas(windowWidth, windowHeight, WEBGL);//a finite area on which to doodle
noStroke();//pencils down - only paint from here on out
specularMaterial(255);//what isn't reflecting or emitting light is but a shadow
}
function draw() {
background(255);//math is made up - imagined - of the mind
t = frameCount / 200;//the past is but a shadow of time
camera(//a perspective is everything
w / 1.5 + w * abs(sin(t / 5)),
w / 1.5 + w * abs(sin(t / 2) * cos(t)),
w / 1.5 + w * abs(cos(t / 3))
);
pointLight(//a spotlight reveals shadows
255,
255,
255,
-2 * w * sin(t / 3),
2 * w * sin(t / 2),
2 * w * cos(t / 5)
);
pointLight(//more than one light illumines structure
255,
255,
255,
2 * w * cos(t) * cos(t),
2 * w * cos(t / 2),
2 * w * cos(t)
);
pointLight(//3 lights might just let us know dimension
255,
255,
255,
2 * w * sin(t),
-2 * w * sin(t),
2 * w * sin(t) * cos(t)
);
sphere(w / 2, 50, 50);//the curves of you
}