# \[GIF\] Jumping cube completion

**URL:** <https://community.wolfram.com/t/gif-jumping-cube-completion/8628>\
**Category:** Staff Picks\
**Tags:** computational-arts, geometry, graphics-and-visualization, interface-construction, staff-pick\
**Created:** [May 25, 2016, 9:39pm UTC](https://community.wolfram.com/t/gif-jumping-cube-completion/8628 "2016-05-25T21:39:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [May 25, 2016, 9:39pm UTC](https://community.wolfram.com/t/gif-jumping-cube-completion/8628/1 "2016-05-25T21:39:43Z")

</div>

![5426out.gif](https://global.discourse-cdn.com/wolfram/original/2X/5/5a1a50a03c87c00ec04b9b044c5bfc6d04954cd4.gif)

## Jumping cube completion

Recursively a small cube completes a bigger cube…

```
colors={RGBColor[0.91,0.25,0.1],RGBColor[0.25,0.71,0.1]}
nearcubeside={Polygon[{{3,0,0},{3,3,0},{3,3,2},{3,2,2},{3,2,3},{3,0,3}}],Polygon[{{2,2,2},{2,3,2},{2,3,3},{2,2,3}}]};
nearcube={nearcubeside,Rotate[nearcubeside,120\[Degree],{1,1,1}],Rotate[nearcubeside,240\[Degree],{1,1,1}]};
cube=Cuboid[-0.5{1,1,1},0.5{1,1,1}];
cube={Polygon[0.5{{1,-1,-1},{1,1,-1},{1,1,1},{1,-1,1}}],Polygon[0.5{{-1,-1,-1},{-1,1,-1},{-1,1,1},{-1,-1,1}}]};
cube={#,Rotate[#,120\[Degree],{1,1,1}],Rotate[#,240\[Degree],{1,1,1}]}&/@cube;
cube=Riffle[colors,cube];

position=8{1,1,1};

begin=position;
end=2.5{1,1,1};
delta=begin-end;
a=25;
c1=delta[[3]]-a/2;
f=Function[{t},begin-delta{1,1,0}t-{0,0,1}(c1 t + a t^2/2)];

\[Omega]=2\[Pi] 1.5 ;

ClearAll[MakeScene]
MakeScene[\[Tau]_]:=Module[{cubet,obj,pos,spin,camerapos},
    If[\[Tau]<2/3,
        cubet=1.5\[Tau];
        pos=f[cubet];
        spin=\[Omega] cubet;
        obj={nearcube,Translate[Rotate[cube,spin,{1,-1,0}],pos]};
    ,
        obj=Cuboid[{0,0,0},{3,3,3}];
    ];
    camerapos={1,1,1}(10-2.5\[Tau]);
    Graphics3D[{EdgeForm[],colors[[2]],obj},Axes->False,AxesOrigin->{0,0,0},Boxed->False,Lighting->"Neutral",ViewVector->{camerapos,-{1,1,1}},ImageSize->{400,400},ViewAngle->50*Degree,Background->RGBColor[0.05,0.35,0.77]]
]

Manipulate[MakeScene[\[Iota]],{\[Iota],0,1}]

```

---

<div class="post-metadata">

**Author:** ![wolframcommunity](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wolframcommunity/32/8335_2.png) [@wolframcommunity](https://community.wolfram.com/u/wolframcommunity)\
**Post date:** [May 26, 2016, 10:27pm UTC](https://community.wolfram.com/t/gif-jumping-cube-completion/8628/2 "2016-05-26T22:27:46Z")

</div>

![2015-11-02_10-07-11.png](https://global.discourse-cdn.com/wolfram/original/3X/5/0/50e59c9ead62f729e7130d3ea1482555a75602b6.png)

- another post of yours has been selected for the [Staff Picks](http://community.wolfram.com/content?curTag=staff+picks) group, congratulations !

We are happy to see you at the tops of the [“Featured Contributor” board](http://wolfr.am/featured). Thank you for your wonderful contributions, and please keep them coming!
