How to make a mirror ball? like in a nightclub

Hello everyone,
For now in my project, I move spheres like pendulums or metronomes.
Now instead of spheres, I would like to have mirror balls.
Is it easy to create a mirror ball?
Later, I would like to light it with a more or less wide light ray from a place (top left for example) and have the rays reflected by the different mirrors of the mirror ball.
If it’s really complicated, I want to pay you for this work, because I have a lot of other things to do in my project.


Do you simulate it in 2d or 3d?

1 Like

Absolutely, in 3D :wink:

Ok, that’s really complicated in processing. I would recommend you to use something like Unity or some other programming engine.
But if you really want to do this with processing, the only way I know is to send out lots of rays that react with your sphere.

In Unity you would do this with a compute shader like in this video. You can try to implement this to processing, but i’m not that good that I could help you with it.

1 Like

*and you can look at this article: GPU Ray Tracing in Unity – Part 1 – Three Eyed Games

1 Like

I made this example just to show you that we can have reflects of a mirror ball, but instead of having the reflects of the facets, we have reflects of the edges of the sphere.
So how could we have reflects from mirrors and not edges? I think, by making a library of rays whom positions depending of the center of the mirrors? No?

int concentration = 5000; // Try values 1 -> 10000
float move=0.00001;
float x;
void setup() {
  size(640, 360, P3D);
  colorMode(RGB, 1);

void draw() {
  spotLight(102, 153, 204,mouseX , mouseY, 1800, 0, 0, -1, PI/2,concentration); 
  float d = mouseX / float(width);
  translate(width/2, height/2, 0); 
  x= 100*cos(move);
  directionalLight(0.8, 0.8, 0.8, d, -300, -100);

  translate(30+7*x, 200, -200); 
1 Like