#include "colors.inc"

  camera {
    right x
    location <0, 0, -100>
    look_at 0
    angle 2
  }  
light_source { <-50,50,-100> White }
light_source { <-50,-50,-100> White }
light_source { <50,50,-100> White }
light_source { <50,-50,-100> White }


#declare b=1;
#declare A=b*<-1,-1,-1>;
#declare B=b*<1,-1,-1>;
#declare C=b*<1,1,-1>;
#declare D=b*<-1,1,-1>;
#declare E=b*<-1,-1,1>;
#declare F=b*<1,-1,1>;
#declare G=b*<1,1,1>;
#declare H=b*<-1,1,1>;
#declare r_cube=b/50;
#declare ABCD=(A+B+C+D)/4;
#declare EFGH=(E+F+G+H)/4;
#declare ADHE=(A+D+H+E)/4;
#declare BCGF=(B+C+G+F)/4;
#declare ABFE=(A+B+F+E)/4;
#declare DCHG=(D+C+H+G)/4;
#if (clock<1)
#declare k=1;
#end
#if ((clock-1)*(clock-2)<=0)
#declare k=1-(clock-1);
#end
#if (clock>2)
#declare k=0;
#end
#declare cube_fil=union
#declare r=b/100;
{
cylinder{A,B,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{B,C,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{C,D,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{D,A,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{E,F,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{F,G,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{G,H,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{H,E,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{A,E,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{B,F,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{C,G,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}
cylinder{D,H,r texture{ pigment{ color rgb<1,1,1>}}no_shadow}

cylinder{ADHE,ABCD,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{ADHE,ABFE,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{ADHE,DCHG,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{ADHE,EFGH,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}

cylinder{BCGF,ABCD,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{BCGF,ABFE,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{BCGF,DCHG,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{BCGF,EFGH,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}

cylinder{ABFE,ABCD,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{ABCD,DCHG,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{EFGH,DCHG,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
cylinder{ABFE,EFGH,r texture{ pigment{ color rgb<1,0.5,0>}}no_shadow}
#if (clock>3)
polygon{
    4,EFGH,ADHE,ABFE,EFGH
    pigment { color rgb<1,0,0> }no_shadow 
  }
polygon{
    4,EFGH,ABFE,BCGF,EFGH
    pigment { color rgb<0,1,0> }no_shadow 
  }
polygon{
    4,EFGH,BCGF,DCHG,EFGH
    pigment { color rgb<0,0,1> }no_shadow 
  }
  
polygon{
    4,EFGH,DCHG,ADHE,EFGH
    pigment { color rgb<1,1,0> }no_shadow 
  }
  
polygon{
    4,ABCD,ADHE,ABFE,ABCD
    pigment { color rgb<0,0,1> }no_shadow 
  }
polygon{
    4,ABCD,ABFE,BCGF,ABCD
    pigment { color rgb<1,1,0> }no_shadow 
  }
polygon{
    4,ABCD,BCGF,DCHG,ABCD
    pigment { color rgb<1,0,0> }no_shadow 
  }
  
polygon{
    4,ABCD,DCHG,ADHE,ABCD
    pigment { color rgb<0,1,0> }no_shadow 
  }
#end
polygon{
    5,k*(A-ABCD)+ABCD,k*(B-ABCD)+ABCD,k*(C-ABCD)+ABCD,k*(D-ABCD)+ABCD,k*(A-ABCD)+ABCD
    pigment { color rgb<1,1,0> }no_shadow 
  }
sphere{ABCD,r_cube pigment { color rgb<0,0,1> }no_shadow}
polygon{
    5,k*(E-EFGH)+EFGH,k*(F-EFGH)+EFGH,k*(G-EFGH)+EFGH,k*(H-EFGH)+EFGH,k*(E-EFGH)+EFGH
    pigment { color rgb<1,1,0> }no_shadow 
  }
sphere{EFGH,r_cube pigment { color rgb<0,0,1> }no_shadow}
polygon{
    5,k*(A-ADHE)+ADHE,k*(D-ADHE)+ADHE,k*(H-ADHE)+ADHE,k*(E-ADHE)+ADHE,k*(A-ADHE)+ADHE
    pigment { color rgb<1,0,0> }no_shadow 
  }
sphere{ADHE,r_cube pigment { color rgb<0,1,0> }no_shadow}  
polygon{
    5,k*(B-BCGF)+BCGF,k*(C-BCGF)+BCGF,k*(G-BCGF)+BCGF,k*(F-BCGF)+BCGF,k*(B-BCGF)+BCGF
    pigment { color rgb<1,0,0> }no_shadow 
  }
sphere{BCGF,r_cube pigment { color rgb<0,1,0> }no_shadow}  
polygon{
    5,k*(C-DCHG)+DCHG,k*(G-DCHG)+DCHG,k*(H-DCHG)+DCHG,k*(D-DCHG)+DCHG,k*(C-DCHG)+DCHG
    pigment { color rgb<0,1,0> }no_shadow 
  }
sphere{DCHG,r_cube pigment { color rgb<1,0,0> }no_shadow}  
polygon{
    5,k*(B-ABFE)+ABFE,k*(F-ABFE)+ABFE,k*(E-ABFE)+ABFE,k*(A-ABFE)+ABFE,k*(B-ABFE)+ABFE
    pigment { color rgb<0,1,0> }no_shadow 
  }
sphere{ABFE,r_cube pigment { color rgb<1,0,0> }no_shadow}

};

object
{
cube_fil
rotate 72*clock*x
rotate 360*clock*y
rotate 180*clock*z
}


