How can I create a cube showing six distinct number grids, one on each face.
I want to use Grid
and Graphics3D
, but don't know how to connect them together.
For example, the following code makes a cube out of a grid (Grid
was called once so all the cube sides have the same type of elements):
vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
(*VertexTextureCoordinates*)
coords =
{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}},
{{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}},
{{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}},
{{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}},
{{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}},
{{0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}}};
n = 9;(*Matrix Dimension*)
color = {Red, Blue, Green, Yellow, Orange, Black};
Table[
mat[k] =
Grid[Table[RandomInteger[{1, n^2}], {i, 1, n}, {j, 1, n}],
ItemStyle ->
Table[
{FontSize -> 20, Bold, RandomChoice[color]},
{i, 1, n}, {j, 1, n}],
Frame -> All],
{k, 1, 6}];
(*For 3D visual*)
Graphics3D[
Table[
{Texture[mat[k]], Polygon[coords[[k]], VertexTextureCoordinates -> vtc]},
{k, 1, 6}],
Boxed -> False]
(*use the same coords and vtc as before*)
I would greatly appreciate it if you could help me.
Grids
. You can't meanGrid
because that is a formatting function, not a graphics function. Do you mean a lattice when you writegrid
? Also, it there are six different grids, what distinguishes them? $\endgroup$n
on each face? If so, how will those values be determined? $\endgroup$