Get the vertical axis of object's array

Hello,

You have 8 cubes and 4 is half of that… that is what I used to center it.

Try changing the 4 from 0 to 8 and see what happens!

Try this:

float num = map(mouseX, 0, width, 0, 8); //This comes in very handy!

translate(width/2, height/2);
rotateY(howMany);
translate(-num*16, -num*16, -num*16);  //This will translate it to center

Reference to map():
https://processing.org/reference/map_.html

You may want to consider using this:
https://processing.org/reference/lights_.html

:)