I am trying to visualize scalar field in three dimension generated from some simulations with tuples $(x, y, z, w)$ where $w=f (x, y, z)$.
Here is my first attempt
f[x_, y_, z_] := Sin[x/4]*Sin[y/4]*Sin[z/4];
xyzw = Flatten[Table[{x, y, z, f[x, y, z]}, {x, 1, 10}, {y, 1, 10}, {z, 1, 10}] //N, 2];
M = 10;
xyz = xyzw[[;; , {1, 2, 3}]];
w = ArrayReshape[xyzw[[;; , 4]], {M, M, M}];
f[x_, y_, z_] := w[[Round[x] + 1, Round[y] + 1, Round[z] + 1]];
f = ListPointPlot3D[xyz,
ColorFunction -> Function[{x, y, z}, Hue[f[x*M, y*M, z*M]]],
AxesLabel -> {"x", "y", "z"}, PlotStyle -> PointSize[Large]]
And here is the plot:
Some points are missing using this method which generates error, but the key problem is that it is hard to visualize what's scalar field in there, particular with millions of points.
Instead of using small points, is it possible to have filled regular cubes without any gaps so that the inner points is not visible when there are surface points? And then, how can I see any cross-section?