animation = {
let xy_pts = d3
.range(0, 7, 0.5)
.map((x) => d3.range(0, 7, 0.5).map((y) => [x, y]))
.flat();
let xy_grid = create_indexedLineSet(
d3
.range(0, 7, 0.5)
.map((x) => [
[x, 0, 0],
[x, 6.5, 0]
])
.concat(
d3.range(0, 7, 0.5).map((y) => [
[0, y, 0],
[6.5, y, 0]
])
)
);
let z_grid = create_indexedLineSet(
xy_pts.map(([x, y]) => [
[x, y, 0],
[x, y, 1]
]),
{ id: "z_grid", transparency: 0.5 }
);
let marks3d = [xy_grid, z_grid];
xy_pts.forEach(function ([x, y], i) {
marks3d.push(
create_sphere([x, y, 0], 0.1, {
class: `sphere`,
color: "steelblue"
})
);
});
return show_x3d(marks3d, {
width: 700,
height: 700,
extent: [
[-1, 6],
[-1, 6],
[-1, 6]
],
viewpoint: {
position: "11.628657817904852 13.980269669572518 11.404474735618637",
orientation:
"0.15661698617025535 0.4914328750222597 0.856717484933219,2.511923636033063"
}
});
}