function box(x0, y0, n, t) {
let box = create_box([2 / n, 2 / n, f(x0, y0)], {
translation: `${x0 + 1 / n}, ${y0 + 1 / n}, ${f(x0, y0) / 2}`,
color: "#40bfbf",
transparency: t,
class: `box box${n}`
});
let edges = create_indexedLineSet(
[
[
[x0, y0, 0],
[x0, y0, f(x0, y0)]
],
[
[x0 + 2 / n, y0, 0],
[x0 + 2 / n, y0, f(x0, y0)]
],
[
[x0 + 2 / n, y0 + 2 / n, 0],
[x0 + 2 / n, y0 + 2 / n, f(x0, y0)]
],
[
[x0, y0 + 2 / n, 0],
[x0, y0 + 2 / n, f(x0, y0)]
],
[
[x0, y0, f(x0, y0)],
[x0 + 2 / n, y0, f(x0, y0)],
[x0 + 2 / n, y0 + 2 / n, f(x0, y0)],
[x0, y0 + 2 / n, f(x0, y0)],
[x0, y0, f(x0, y0)]
],
[
[x0, y0, 0],
[x0 + 2 / n, y0, 0],
[x0 + 2 / n, y0 + 2 / n, 0],
[x0, y0 + 2 / n, 0],
[x0, y0, 0]
]
],
{ transparency: t, class: `box box${n}` }
);
return [box, edges];
}