//Dodecahedron DEFINED BY THE COORDINATES OF ITS VERTICES AND POLYGONS //Files with predefined colors and textures #include "colors.inc" #include "glass.inc" #include "golds.inc" #include "metals.inc" #include "stones.inc" #include "woods.inc" //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 <30,10,10> //Camera location look_at <0,0,0> //Where camera is pointing angle 5 //Angle of the view--increase to see more, decrease to see less } //Ambient light to "brighten up" darker pictures global_settings { ambient_light White*2 } //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 } light_source {<-10,5,10> color White*2 } //Set a background color background { color VLightGrey } //Construct a docecahedron by describing its polygons //The 20 vertices #declare tt=(sqrt(5)-1)/2; #declare w1=; #declare w2=<-tt,0,-1>; #declare w3=<0,-1,tt>; #declare w4=<0,-1,-tt>; #declare w5=<-1,tt,0>; #declare w6=<-1,-tt,0>; #declare w7=<0,1,tt>; #declare w8=<0,1,-tt>; #declare w9=<1,tt,0>; #declare w10=<1,-tt,0>; #declare w11=; #declare w12=<-tt,0,1>; #declare v1 = (w1+w8+w9)/3; #declare v2 = (w1+w9+w10)/3; #declare v3 = (w1+w4+w10)/3; #declare v4 = (w1+w2+w8)/3; #declare v5 = (w1+w2+w4)/3; #declare v6 = (w7+w11+w12)/3; #declare v7 = (w5+w7+w12)/3; #declare v8 = (w5+w6+w12)/3; #declare v9 = (w3+w6+w12)/3; #declare v10 = (w3+w11+w12)/3; #declare v11 = (w3+w10+w11)/3; #declare v12 = (w9+w10+w11)/3; #declare v13 = (w7+w9+w11)/3; #declare v14 = (w7+w8+w9)/3; #declare v15 = (w5+w7+w8)/3; #declare v16 = (w2+w5+w6)/3; #declare v17 = (w2+w4+w6)/3; #declare v18 = (w2+w5+w8)/3; #declare v19 = (w3+w4+w10)/3; #declare v20 = (w3+w4+w6)/3; //The 12 pentagonal faces #declare fd1 = polygon { 6, v1, v4, v18, v15, v14, v1 texture{pigment {color rgbf <0,0,1,0>}}}; #declare fd2 = polygon { 6, v1, v2, v3, v5, v4, v1 texture{pigment {color rgbf <0,1,0,0>}}}; #declare fd3 = polygon { 6, v1, v2, v12, v13, v14, v1 texture{pigment {color rgbf <1,0,0,0>}}}; #declare fd4 = polygon { 6, v2, v3, v19, v11, v12, v2 texture{pigment {color rgbf <0,0,.5,0>}}}; #declare fd5 = polygon { 6, v3, v5, v17, v20, v19, v3 texture{pigment {color rgbf <0,.5,0,0>}}}; #declare fd6 = polygon { 6, v4, v5, v17, v16, v18, v4 texture{pigment {color rgbf <.5,0,0,0>}}}; #declare fd7 = polygon { 6, v7, v8, v16, v18, v15, v7 texture{pigment {color rgbf <0,.5,1,0>}}}; #declare fd8 = polygon { 6, v6, v10, v11, v12, v13, v6 texture{pigment {color rgbf <.5,0,1,0>}}}; #declare fd9 = polygon { 6, v6, v7, v15, v14, v13, v6 texture{pigment {color rgbf <.5,1,0,0>}}}; #declare fd10 = polygon { 6, v6, v7, v8, v9, v10, v6 texture{pigment {color rgbf <1,0,.5,0>}}}; #declare fd11 = polygon { 6, v8, v9, v20, v17, v16, v8 texture{pigment {color rgbf <1,.5,0,0>}}}; #declare fd12 = polygon { 6, v9, v10, v11, v19, v20, v9 texture{pigment {color rgbf <0,.5,1,0>}}}; //Unite the faces to form the dodecahedron #declare mydodecahedron = 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} } } //List the defined object(s) to be displayed mydodecahedron