| Author |
Comment/Response |
Michael
|
12/09/12 08:43am
In Response To 'Re: Re: An Array of Cuboids' --------- Try
baseCoords = RandomSample[Tuples[Range[5]/6., 3], 5^3];
Manipulate[
Graphics3D[
Table[{RGBColor @@ p, Opacity[.75], Cuboid[p, p + .15]}, {p,
Take[baseCoords, n]}], PlotRange -> Table[{1/6 - 1/60, 1}, {3}]],
{n, 1, 5^3, 1},
Button["shuffle",
baseCoords = RandomSample[Tuples[Range[5]/6., 3], 5^3]]
]
Manipulate will display any expression, and re-display the expression any time its variables are changed.
(I modified Bill's way of getting the coordinates, so I could randomize the order and take the first n of them.)
URL: , |
|