Message Boards Message Boards

GROUPS:

[GIF] Exchange (Interchanging cubes)

Posted 2 years ago
2392 Views
|
1 Reply
|
6 Total Likes
|

Interchanging cubes

Exchange

Just something simple this time. Here's the code:

DynamicModule[
 {clist, v, e, cols = RGBColor /@ {"#F85F73", "#283C63"}},
 clist = Permute[
   Flatten[Table[{x, y, z} - {1/2, 1/2, 1/2}, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}], 2], {1, 6, 2, 5, 8, 7, 3, 4}];
 v = PolyhedronData["Cube", "VertexCoordinates"];
 e = PolyhedronData["Cube", "Edges"][[2]];
 Manipulate[
  Graphics3D[{Thickness[.004], cols[[1]],
    Table[
     GraphicsComplex[
      2 ((1 - Haversine[π t]) clist[[i]] + Haversine[π t] RotateLeft[clist][[i]]) + # & /@ v, e], {i, 1, 8}]},
   Boxed -> False, PlotRange -> 2, ImageSize -> 540, 
   ViewPoint -> {0, 2, 0}, SphericalRegion -> True, 
   Background -> cols[[-1]]],
  {t, 0., 1}]
 ]

enter image description here - you have earned "Featured Contributor" badge, congratulations !

This is a great post and it has been selected for the curated Staff Picks group. Your profile is now distinguished by a "Featured Contributor" badge and displayed on the "Featured Contributor" board.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract