Message Boards Message Boards

[GIF] Exchange (Interchanging cubes)

GROUPS:

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}]
 ]
POSTED BY: Clayton Shonkwiler
Answer
10 months ago

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
Answer
10 months ago

Group Abstract Group Abstract