//EXAMPLE OF PROJECTION OF 24 Cell // Done in different Colors. Sets of vertices the farthest distance away are done in different colors. //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 <10,20,30> //Camera location look_at <0,0,0> //Where camera is pointing angle 10 //Angle of the view } //Ambient light to "brighten up" darker pictures global_settings { ambient_light White } global_settings { max_trace_level 10 } //Place a light light_source { <10,20,30> color White*2 } //Set a background color background { color White } //List the vertices of the 24 Cell #declare p = array[24][4] { { 0, 0,-1,-1}, //0 { 0, 0,-1, 1}, //1 { 0, 0, 1,-1}, //2 { 0, 0, 1, 1}, //3 { 0,-1, 0,-1}, //4 { 0,-1, 0, 1}, //5 { 0, 1, 0,-1}, //6 { 0, 1, 0, 1}, //7 { 0,-1,-1, 0}, //8 { 0,-1, 1, 0}, //9 { 0, 1,-1, 0}, //10 { 0, 1, 1, 0}, //11 {-1, 0, 0,-1}, //12 {-1, 0, 0, 1}, //13 { 1, 0, 0,-1}, //14 { 1, 0, 0, 1}, //15 {-1, 0,-1, 0}, //16 {-1, 0, 1, 0}, //17 { 1, 0,-1, 0}, //18 { 1, 0, 1, 0}, //19 {-1,-1, 0, 0}, //20 {-1, 1, 0, 0}, //21 { 1,-1, 0, 0}, //22 { 1, 1, 0, 0} //23 }; //Create the array to collect the projected points #declare q = array[24]; //Specify the direction of projection #declare a=1; #declare b=1; #declare c=1; #declare d=1; //Project the points #declare l=sqrt(a*a+b*b+c*c+d*d); #declare i=0; #while(i<24) #declare q[i]= < (d*p[i][0]+c*p[i][1]-b*p[i][2]-a*p[i][3])/l, (-c*p[i][0]+d*p[i][1]+a*p[i][2]-b*p[i][3])/l, (b*p[i][0]-a*p[i][1]+d*p[i][2]-c*p[i][3])/l >; #declare i=i+1; #end #declare r=.03; //96 Edges of the projection union{ cylinder {q[0], q[4],r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[0], q[6],r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[0], q[8],r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[0], q[10],r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[0], q[12], r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[0], q[14], r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[0], q[16], r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[0], q[18], r texture{pigment {color rgbf <1,0,0,0>}}} cylinder {q[1], q[5], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[1], q[7], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[1], q[8], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[1], q[10], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[1], q[13], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[1], q[15], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[1], q[16], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[1], q[18], r texture{pigment {color rgbf <0,1,0,0>}}} cylinder {q[2], q[4], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[2], q[6], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[2], q[9], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[2], q[11], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[2], q[12], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[2], q[14], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[2], q[11], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[2], q[17], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[2], q[19], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[3], q[5], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[3], q[7], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[3], q[9], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[3], q[11], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[3], q[13], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[3], q[15], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[3], q[17], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[3], q[19], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[4], q[8], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[4], q[9], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[4], q[12], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[4], q[14], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[4], q[20], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[4], q[22], r texture{pigment {color rgbf <0,0,1,0>}}} cylinder {q[5], q[8], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[5], q[9], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[5], q[13], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[5], q[15], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[5], q[20], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[5], q[22], r texture{pigment {color rgbf <1,1,0,0>}}} cylinder {q[6], q[10], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[6], q[11], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[6], q[12], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[6], q[14], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[6], q[21], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[6], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} cylinder {q[7], q[10], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[7], q[11], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[7], q[13], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[7], q[15], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[7], q[21], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[7], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} cylinder {q[8], q[16], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[8], q[18], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[8], q[20], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[8], q[22], r texture{pigment {color rgbf <1,0,1,0>}}} cylinder {q[9], q[17], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[9], q[19], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[9], q[20], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[9], q[22], r texture{pigment {color rgbf <0,1,1,0>}}} cylinder {q[10], q[16], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[10], q[18], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[10], q[21], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[10], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} cylinder {q[11], q[17], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[11], q[19], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[11], q[21], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[11], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} cylinder {q[12], q[16], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[12], q[17], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[12], q[20], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[12], q[21], r texture{pigment {color rgbf <2,0,0,0>}}} cylinder {q[13], q[16], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[13], q[17], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[13], q[20], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[13], q[21], r texture{pigment {color rgbf <0,2,0,0>}}} cylinder {q[14], q[18], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[14], q[19], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[14], q[22], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[14], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} cylinder {q[15], q[18], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[15], q[19], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[15], q[22], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[15], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} cylinder {q[16], q[20], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[16], q[21], r texture{pigment {color rgbf <0,0,2,0>}}} cylinder {q[17], q[20], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[17], q[21], r texture{pigment {color rgbf <2,2,0,0>}}} cylinder {q[18], q[22], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[18], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} cylinder {q[19], q[22], r texture{pigment {color rgbf <0,2,2,0>}}} cylinder {q[19], q[23], r texture{pigment {color rgbf <2,0,2,0>}}} //texture {T_Gold_1A} } //Vertices of the projection union{ sphere{q[0],r texture{pigment {color rgbf <1,0,0,0>}}} sphere{q[1],r texture{pigment {color rgbf <0,1,0,0>}}} sphere{q[2],r texture{pigment {color rgbf <0,1,0,0>}}} sphere{q[3],r texture{pigment {color rgbf <1,0,0,0>}}} sphere{q[4],r texture{pigment {color rgbf <0,0,1,0>}}} sphere{q[5],r texture{pigment {color rgbf <1,1,0,0>}}} sphere{q[6],r texture{pigment {color rgbf <1,1,0,0>}}} sphere{q[7],r texture{pigment {color rgbf <0,0,1,0>}}} sphere{q[8],r texture{pigment {color rgbf <1,0,1,0>}}} sphere{q[9],r texture{pigment {color rgbf <0,1,1,0>}}} sphere{q[10],r texture{pigment {color rgbf <0,1,1,0>}}} sphere{q[11],r texture{pigment {color rgbf <1,0,1,0>}}} sphere{q[12],r texture{pigment {color rgbf <2,0,0,0>}}} sphere{q[13],r texture{pigment {color rgbf <0,2,0,0>}}} sphere{q[14],r texture{pigment {color rgbf <0,2,0,0>}}} sphere{q[15],r texture{pigment {color rgbf <2,0,0,0>}}} sphere{q[16],r texture{pigment {color rgbf <0,0,2,0>}}} sphere{q[17],r texture{pigment {color rgbf <2,2,0,0>}}} sphere{q[18],r texture{pigment {color rgbf <2,2,0,0>}}} sphere{q[19],r texture{pigment {color rgbf <0,0,2,0>}}} sphere{q[20],r texture{pigment {color rgbf <1,1,1,0>}}} sphere{q[21],r texture{pigment {color rgbf <0,2,2,0>}}} sphere{q[22],r texture{pigment {color rgbf <0,2,2,0>}}} sphere{q[23],r texture{pigment {color rgbf <2,0,2,0>}}} //texture {T_Gold_1A} }