Get a 3d cube made of cubes to expand from the center

Hello, I made this sketch
Link to sketch
as you can see its a cube made of smaller cubes that expand and retract using sin.
My problem is that the smaller cubes expand and retract from the corner cube and not from the center cube.

Your initial translation needs to be relative to the currently calculated gap:

  translate(-(gap + 40) * 4.5, -(gap + 40) * 4.5, -(gap + 40) * 4.5);
1 Like