-1
$\begingroup$

On a related topics, here. I am wondering if it is possible to make a better visualisation of this svg file in Mathematica, so I can see it in 3D and rotate it too.

Note if you pause your mouse onto any "day", this is actually an animation.

The number of (total) gifts of this problem is really easy and we can just use something like

Accumulate[Accumulate[Table[i, {i, 12}]]]
$\endgroup$
  • $\begingroup$ The total is has a closed form solution and is given by (1/6)*n*(1 + n)*(2 + n) /. n -> 12 $\endgroup$ – m_goldberg Dec 29 '17 at 21:45
  • $\begingroup$ @m_goldberg yes I know. It's also very easy to derive. $\endgroup$ – Chen Stats Yu Dec 29 '17 at 21:46
  • $\begingroup$ what are you asking? $\endgroup$ – george2079 Dec 29 '17 at 21:47
  • $\begingroup$ @m_goldberg To make a 3D version of the SVG file in Mathematica if possible. $\endgroup$ – Chen Stats Yu Dec 29 '17 at 21:48
  • $\begingroup$ @george2079 To make a 3D version of the SVG file in Mathematica if possible. $\endgroup$ – Chen Stats Yu Dec 29 '17 at 22:15
2
$\begingroup$

This can be a starting point:

vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
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}}};
box = Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]];

boxes = {Texture[ImageResize[ExampleData[#], 50]], box} & /@ 
   RandomSample[ExampleData["ColorTexture"], 12];

mgift = Table[
   NestList[Translate[#, {-1, 0, 0}] &, 
    Translate[boxes[[i]], {0, 0, i - 1}], i - 1], {i, 1, 12}];

agift = Table[
   Rest@NestList[Translate[#, {0, 1.3, 0}] &, 
     Translate[mgift[[i]], {0, 1.3 (i - 1), 0}], 13 - i], {i, 1, 12}];

Graphics3D[agift, Boxed -> False, ImageSize -> 600]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.