Can anyone tell me the way to generate a 3D Voronoi Diagram like the one given at http://mathworld.wolfram.com/VoronoiDiagram.html. I need to draw the 4th diagram on this page (Second row, last plot).
pts = RandomReal[{}, {20, 3}];
Show[{
ListPlot3D[pts, InterpolationOrder -> 0, Mesh -> None,
Filling -> Bottom, ColorFunction -> "Rainbow",
PlotRange -> {{0, 1}, {0, 1}, Automatic}],
Graphics3D[{PointSize[.02], Point[pts]}]},
ImageSize -> Medium ]
I copied this from the notebook on the page you linked.
In that plot the points are only on the top of the structures. I need to have points in-between the structures also (some of them needs to be visible).
For this we can simply take the z-coordinate and divide it by two for the plotted points.
There needs to be two sets of points with two different colours. The ratio of density for the two sets of points should be 2-3 times.
For this we will make two different plots and combine them with Show
plot1 = Show[{
ListPlot3D[pts1, InterpolationOrder -> 0, Mesh -> None,
Filling -> Bottom, PlotStyle -> Purple,
PlotRange -> {{0, 1}, {0, 1}, Automatic}],
Graphics3D[{PointSize[.02], Point[{#1, #2, #3/2} & @@@ pts1]}]}
]
plot2 = Show[{
ListPlot3D[pts2, InterpolationOrder -> 0, Mesh -> None,
Filling -> Bottom, PlotStyle -> Green,
PlotRange -> {{0, 1}, {0, 1}, Automatic}],
Graphics3D[{PointSize[.02], Point[{#1, #2, #3/2} & @@@ pts2]}]}
]

Show[plot1, plot2]
