Message Boards Message Boards

[GIF] Exchange (Interchanging cubes)

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.

POSTED BY: Moderation Team
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