Hello,
I made a program with two balls which returns the light coming from different place thanks to the mouse.
I would like to change these balls into a mirror ball (like in clubs) and have the rays of light returned by the mirror ball.
Thanks for your ideas.
/**
* Spot.
*
* Move the mouse the change the position and concentation
* of a blue spot light.
*/
int concentration = 600; // Try values 1 -> 10000
float move=0.00001;
float x;
void setup() {
size(640, 360, P3D);
noStroke();
colorMode(RGB, 1);
fill(0.9);
sphereDetail(60);
}
void draw() {
background(0);
// Orange light on the upper-right of the sphere
spotLight(204, 153, 0, 360, 160, 600, 0, 0, -1, PI/2, 600);
float s = mouseX / float(width);
// Light the bottom of the sphere
s=0;
directionalLight(s*51+51, 102, 126, 0, -1, 0);
// Moving spotlight that follows the mouse
spotLight(102, 153, 204,mouseX , mouseY, 600, 0, 0, -1, PI/2, 600);
float d = mouseX / float(width);
directionalLight(0.8, 0.8, 0.8, d, 0, -1);
lightSpecular(1, 1, 1);
translate(width/2, height/2, 0);
move+=0.01;
x= 100*cos(move);
print (x);
translate(30+x, 200, -500);
sphere(120);
spotLight(102, 153, 204, 300, mouseY, 600, 0, 0, -1, PI/2, 600);
translate(30+7*x, -200, 0);
sphere(120);
}