//FIVE TETRAHEDRA MOVIE //ANIMATE WITH CLOCK FROM 0 TO 7 //Files with predefined colors and textures #include "colors.inc" #include "glass.inc" #include "golds.inc" #include "metals.inc" #include "stones.inc" #include "woods.inc" global_settings { max_trace_level 5 } //Place the camera camera { sky <0,0,1> //Don't change this direction <-1,0,0> //Don't change this right <-4/3,0,0> //Don't change this location <10,10,10> //Camera location look_at <0,0,0> //Where camera is pointing angle 15 //Angle of the view--increase to see more, decrease to see less } global_settings { ambient_light White*2 } //Ambient light to "brighten up" darker pictures //Place a light--you can have more than one! light_source {<10,5,10> color White*2 } light_source {<10,-5,10> color White*2 } //Set a background color background { color VLightGrey } //The Icosahedron (adapted from Laura Berry) //Vertices are defined with tt so that the icosohedron is developed from an octahedron #macro myicosahedron(tt) //The 12 vertices #declare p1 = ; #declare p2 = <-tt,0,-1>; #declare p3 = <0,-1,tt>; #declare p4 = <0,-1,-tt>; #declare p5 = <-1,tt,0>; #declare p6 = <-1,-tt,0>; #declare p7 = <0,1,tt>; #declare p8 = <0,1,-tt>; #declare p9 = <1,tt,0>; #declare p10 = <1,-tt,0>; #declare p11 = ; #declare p12 = <-tt,0,1>; //The 20 triangular faces #declare f1 = polygon { 4, p1, p8, p9, p1}; #declare f2 = polygon { 4, p1, p10, p9, p1}; #declare f3 = polygon { 4, p1, p10, p4, p1}; #declare f4 = polygon { 4, p1, p2, p8, p1}; #declare f5 = polygon { 4, p1, p2, p4, p1}; #declare f6 = polygon { 4, p12, p7, p11, p12}; #declare f7 = polygon { 4, p12, p7, p5, p12}; #declare f8 = polygon { 4, p12, p5, p6, p12}; #declare f9 = polygon { 4, p12, p6, p3, p12}; #declare f10 = polygon { 4, p12, p3, p11, p12}; #declare f11 = polygon { 4, p3, p10, p11, p3}; #declare f12 = polygon { 4, p9, p10, p11, p9}; #declare f13 = polygon { 4, p7, p9, p11, p7}; #declare f14 = polygon { 4, p7, p8, p9, p7}; #declare f15 = polygon { 4, p5, p8, p7, p5}; #declare f16 = polygon { 4, p5, p2, p6, p5}; #declare f17 = polygon { 4, p2, p6, p4, p2}; #declare f18 = polygon { 4, p2, p5, p8, p2}; #declare f19 = polygon { 4, p3, p4, p10, p3}; #declare f20 = polygon { 4, p3, p4, p6, p3}; //Unite the faces to form the icosahedron object { union { object{f1} object{f2} object{f3} object{f4} object{f5} object{f6} object{f7} object{f8} object{f9} object{f10} object{f11} object{f12} object{f13} object{f14} object{f15} object{f16} object{f17} object{f18} object{f19} object{f20} } } #end //The Dodecahedron (adapted from the icosohedron using the center of each icosohedron face as a vertex #macro mydodecahedron(tt) #declare p1 = ; #declare p2 = <-tt,0,-1>; #declare p3 = <0,-1,tt>; #declare p4 = <0,-1,-tt>; #declare p5 = <-1,tt,0>; #declare p6 = <-1,-tt,0>; #declare p7 = <0,1,tt>; #declare p8 = <0,1,-tt>; #declare p9 = <1,tt,0>; #declare p10 = <1,-tt,0>; #declare p11 = ; #declare p12 = <-tt,0,1>; //The 20 vertices #declare v1 = (p1+p8+p9)/3; #declare v2 = (p1+p9+p10)/3; #declare v3 = (p1+p4+p10)/3; #declare v4 = (p1+p2+p8)/3; #declare v5 = (p1+p2+p4)/3; #declare v6 = (p7+p11+p12)/3; #declare v7 = (p5+p7+p12)/3; #declare v8 = (p5+p6+p12)/3; #declare v9 = (p3+p6+p12)/3; #declare v10 = (p3+p11+p12)/3; #declare v11 = (p3+p10+p11)/3; #declare v12 = (p9+p10+p11)/3; #declare v13 = (p7+p9+p11)/3; #declare v14 = (p7+p8+p9)/3; #declare v15 = (p5+p7+p8)/3; #declare v16 = (p2+p5+p6)/3; #declare v17 = (p2+p4+p6)/3; #declare v18 = (p2+p5+p8)/3; #declare v19 = (p3+p4+p10)/3; #declare v20 = (p3+p4+p6)/3; //The 12 pentagonal faces #declare fd1 = polygon { 6, v1, v4, v18, v15, v14, v1 }; #declare fd2 = polygon { 6, v1, v2, v3, v5, v4, v1 }; #declare fd3 = polygon { 6, v1, v2, v12, v13, v14, v1 }; #declare fd4 = polygon { 6, v2, v3, v19, v11, v12, v2 }; #declare fd5 = polygon { 6, v3, v5, v17, v20, v19, v3 }; #declare fd6 = polygon { 6, v4, v5, v17, v16, v18, v4 }; #declare fd7 = polygon { 6, v7, v8, v16, v18, v15, v7 }; #declare fd8 = polygon { 6, v6, v10, v11, v12, v13, v6 }; #declare fd9 = polygon { 6, v6, v7, v15, v14, v13, v6 }; #declare fd10 = polygon { 6, v6, v7, v8, v9, v10, v6 }; #declare fd11 = polygon { 6, v8, v9, v20, v17, v16, v8 }; #declare fd12 = polygon { 6, v9, v10, v11, v19, v20, v9 }; //Unite the faces to form the dodecahedron object { union { object{fd1} object{fd2} object{fd3} object{fd4} object{fd5} object{fd6} object{fd7} object{fd8} object{fd9} object{fd10} object{fd11} object{fd12} } } #end //The 5-Intersecting Tetrahedron (made by creating each tetrahedron from polygons made from specific vertices of the dodecahedron #declare tt=(sqrt(5)-1)/2; #declare p1 = ; #declare p2 = <-tt,0,-1>; #declare p3 = <0,-1,tt>; #declare p4 = <0,-1,-tt>; #declare p5 = <-1,tt,0>; #declare p6 = <-1,-tt,0>; #declare p7 = <0,1,tt>; #declare p8 = <0,1,-tt>; #declare p9 = <1,tt,0>; #declare p10 = <1,-tt,0>; #declare p11 = ; #declare p12 = <-tt,0,1>; //The 20 vertices #declare v1 = (p1+p8+p9)/3; #declare v2 = (p1+p9+p10)/3; #declare v3 = (p1+p4+p10)/3; #declare v4 = (p1+p2+p8)/3; #declare v5 = (p1+p2+p4)/3; #declare v6 = (p7+p11+p12)/3; #declare v7 = (p5+p7+p12)/3; #declare v8 = (p5+p6+p12)/3; #declare v9 = (p3+p6+p12)/3; #declare v10 = (p3+p11+p12)/3; #declare v11 = (p3+p10+p11)/3; #declare v12 = (p9+p10+p11)/3; #declare v13 = (p7+p9+p11)/3; #declare v14 = (p7+p8+p9)/3; #declare v15 = (p5+p7+p8)/3; #declare v16 = (p2+p5+p6)/3; #declare v17 = (p2+p4+p6)/3; #declare v18 = (p2+p5+p8)/3; #declare v19 = (p3+p4+p10)/3; #declare v20 = (p3+p4+p6)/3; //Construct first tetrahedron by describing its polygons //Define the polygons for each of the five sides. //Notice that the last point must be a repetition of the first. //The first number indicates how many points will be listed. #declare f1_1 = polygon { 4, v1, v6, v16, v1 }; #declare f1_2 = polygon { 4, v1, v16, v19, v1 }; #declare f1_3 = polygon { 4, v1, v19, v6, v1 }; #declare f1_4 = polygon { 4, v6, v16, v19, v6 }; //Define the pyramid to be the union of its faces. #declare mytetra1 = object { union { object{f1_1} object{f1_2} object{f1_3} object{f1_4} } pigment { Magenta } }; //--------------------------------------------------------------- //Construct second tetrahedron by describing its polygons //Define the polygons for each of the five sides. //Notice that the last point must be a repetition of the first. //The first number indicates how many points will be listed. #declare f2_1 = polygon { 4, v2, v10, v15, v2 }; #declare f2_2 = polygon { 4, v2, v15, v17, v2 }; #declare f2_3 = polygon { 4, v2, v17, v10, v2 }; #declare f2_4 = polygon { 4, v10, v15, v17, v10 }; //Define the pyramid to be the union of its faces. #declare mytetra2 = object { union { object{f2_1} object{f2_2} object{f2_3} object{f2_4} } pigment { NeonBlue } }; //--------------------------------------------------------------- //Construct third tetrahedron by describing its polygons //Define the polygons for each of the five sides. //Notice that the last point must be a repetition of the first. //The first number indicates how many points will be listed. #declare f3_1 = polygon { 4, v3, v9, v13, v3 }; #declare f3_2 = polygon { 4, v3, v13, v18, v3 }; #declare f3_3 = polygon { 4, v3, v18, v9, v3 }; #declare f3_4 = polygon { 4, v9, v13, v18, v9 }; //Define the pyramid to be the union of its faces. #declare mytetra3 = object { union { object{f3_1} object{f3_2} object{f3_3} object{f3_4} } pigment { White } }; //--------------------------------------------------------------- //Construct fourth tetrahedron by describing its polygons //Define the polygons for each of the five sides. //Notice that the last point must be a repetition of the first. //The first number indicates how many points will be listed. #declare f4_1 = polygon { 4, v4, v7, v12, v4 }; #declare f4_2 = polygon { 4, v4, v12, v20, v4 }; #declare f4_3 = polygon { 4, v4, v20, v7, v4 }; #declare f4_4 = polygon { 4, v7, v12, v20, v7 }; //Define the pyramid to be the union of its faces. #declare mytetra4 = object { union { object{f4_1} object{f4_2} object{f4_3} object{f4_4} } pigment { MandarinOrange } }; //--------------------------------------------------------------- //Construct fifth tetrahedron by describing its polygons //Define the polygons for each of the five sides. //Notice that the last point must be a repetition of the first. //The first number indicates how many points will be listed. #declare f5_1 = polygon { 4, v5, v8, v11, v5 }; #declare f5_2 = polygon { 4, v5, v11, v14, v5 }; #declare f5_3 = polygon { 4, v5, v14, v8, v5 }; #declare f5_4 = polygon { 4, v8, v11, v14, v8 }; //Define the pyramid to be the union of its faces. #declare mytetra5 = object { union { object{f5_1} object{f5_2} object{f5_3} object{f5_4} } pigment { Yellow } }; //--------------------------------------------------------------- //Intersect the 5 tetrahedron #declare myonetetra= merge{ object{mytetra1} } #declare mytwotetra= merge{ object{mytetra1} object{mytetra2} } #declare mythreetetra= merge{ object{mytetra1} object{mytetra2} object{mytetra3} } #declare myfourtetra= merge{ object{mytetra1} object{mytetra2} object{mytetra3} object{mytetra4} } #declare myfivetetra= merge{ object{mytetra1} object{mytetra2} object{mytetra3} object{mytetra4} object{mytetra5} } #declare rate=90; #declare f=.7; #switch(clock) #range(0,1) #declare s=clock; #declare tt=0; union{ box{<-1,-1,-1>,<1,1,1> texture{ pigment{ color rgbf <1,s,s,s*f>}}} object{myicosahedron(0.0001) texture{pigment {color rgbf <0,1,0,0>}}} rotate<0,0,clock*rate> } #break #range(1.0001,1.5) #declare s=clock-1; #declare r=s*(sqrt(5)-1)/2; union{ box{<-1,-1,-1>,<1,1,1> texture{ pigment{ color rgbf <1,1,1,f>}}} object{myicosahedron(r) texture{pigment {color rgbf <0,1,0,0>}}} rotate<0,0,clock*rate> } #break #range(1.5001,2) #declare s=clock-1; #declare r=(sqrt(5)-1)/2; union{ object{myicosahedron(r) texture{pigment {color rgbf }}} object{mydodecahedron(r) texture{pigment{color rgbf <1,0,0,0>}}} rotate<0,0,clock*rate> } #break #range(2.0001,3) #declare r=(sqrt(5)-1)/2; object{mydodecahedron(r) texture{pigment{color rgbf <1,0,0,0>}} rotate <0,0,clock*rate>} #break #range(3.0001,4) #declare s=clock-3; #declare r=(sqrt(5)-1)/2; union{ object{mydodecahedron(r) texture{pigment {color rgbf <1,s,s,s*f>}}} object{myonetetra texture{pigment{color Gold*2}}} rotate<0,0,clock*rate> } #break #range(4.0001,4.5) #declare r=(sqrt(5)-1)/2; object{mytwotetra texture{pigment{color Gold*2}} rotate <0,0,clock*rate>} #break #range(4.5001,5) #declare r=(sqrt(5)-1)/2; object{mythreetetra texture{pigment{color Gold*2}} rotate <0,0,clock*rate>} #break #range(5.0001,5.5) #declare r=(sqrt(5)-1)/2; object{myfourtetra texture{pigment{color Gold*2}} rotate <0,0,clock*rate>} #break #range(5.5001,6) #declare r=(sqrt(5)-1)/2; object{myfivetetra texture{pigment{color Gold*2}} rotate <0,0,clock*rate>} #break #range(6.0001,7) #declare r=(sqrt(5)-1)/2; union{ object{mydodecahedron(r) texture{pigment {color rgbf <1,1,1,0.7>}}} object{myfivetetra texture{pigment{color Gold*2}}} rotate<0,0,clock*rate> } #break #end