//EXAMPLE OF PROJECTION OF 24 Cell //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=.035; //96 Edges of the projection union{ cylinder {q[0], q[4],r} cylinder {q[0], q[6],r} cylinder {q[0], q[8],r} cylinder {q[0], q[10],r} cylinder {q[0], q[12], r} cylinder {q[0], q[14], r} cylinder {q[0], q[16], r} cylinder {q[0], q[18], r} cylinder {q[1], q[5], r} cylinder {q[1], q[7], r} cylinder {q[1], q[8], r} cylinder {q[1], q[10], r} cylinder {q[1], q[13], r} cylinder {q[1], q[15], r} cylinder {q[1], q[16], r} cylinder {q[1], q[18], r} cylinder {q[2], q[4], r} cylinder {q[2], q[6], r} cylinder {q[2], q[9], r} cylinder {q[2], q[11], r} cylinder {q[2], q[12], r} cylinder {q[2], q[14], r} cylinder {q[2], q[11], r} cylinder {q[2], q[17], r} cylinder {q[2], q[19], r} cylinder {q[3], q[5], r} cylinder {q[3], q[7], r} cylinder {q[3], q[9], r} cylinder {q[3], q[11], r} cylinder {q[3], q[13], r} cylinder {q[3], q[15], r} cylinder {q[3], q[17], r} cylinder {q[3], q[19], r} cylinder {q[4], q[8], r} cylinder {q[4], q[9], r} cylinder {q[4], q[12], r} cylinder {q[4], q[14], r} cylinder {q[4], q[20], r} cylinder {q[4], q[22], r} cylinder {q[5], q[8], r} cylinder {q[5], q[9], r} cylinder {q[5], q[13], r} cylinder {q[5], q[15], r} cylinder {q[5], q[20], r} cylinder {q[5], q[22], r} cylinder {q[6], q[10], r} cylinder {q[6], q[11], r} cylinder {q[6], q[12], r} cylinder {q[6], q[14], r} cylinder {q[6], q[21], r} cylinder {q[6], q[23], r} cylinder {q[7], q[10], r} cylinder {q[7], q[11], r} cylinder {q[7], q[13], r} cylinder {q[7], q[15], r} cylinder {q[7], q[21], r} cylinder {q[7], q[23], r} cylinder {q[8], q[16], r} cylinder {q[8], q[18], r} cylinder {q[8], q[20], r} cylinder {q[8], q[22], r} cylinder {q[9], q[17], r} cylinder {q[9], q[19], r} cylinder {q[9], q[20], r} cylinder {q[9], q[22], r} cylinder {q[10], q[16], r} cylinder {q[10], q[18], r} cylinder {q[10], q[21], r} cylinder {q[10], q[23], r} cylinder {q[11], q[17], r} cylinder {q[11], q[19], r} cylinder {q[11], q[21], r} cylinder {q[11], q[23], r} cylinder {q[12], q[6], r} cylinder {q[12], q[16], r} cylinder {q[12], q[17], r} cylinder {q[12], q[20], r} cylinder {q[12], q[21], r} cylinder {q[13], q[16], r} cylinder {q[13], q[17], r} cylinder {q[13], q[20], r} cylinder {q[13], q[21], r} cylinder {q[14], q[18], r} cylinder {q[14], q[19], r} cylinder {q[14], q[22], r} cylinder {q[14], q[23], r} cylinder {q[15], q[18], r} cylinder {q[15], q[19], r} cylinder {q[15], q[22], r} cylinder {q[15], q[23], r} cylinder {q[16], q[20], r} cylinder {q[16], q[21], r} cylinder {q[17], q[20], r} cylinder {q[17], q[21], r} cylinder {q[18], q[22], r} cylinder {q[18], q[23], r} cylinder {q[19], q[22], r} cylinder {q[19], q[23], r} texture {T_Gold_1A} } //Vertices of the projection union{ sphere{q[0],r} sphere{q[1],r} sphere{q[2],r} sphere{q[3],r} sphere{q[4],r} sphere{q[5],r} sphere{q[6],r} sphere{q[7],r} sphere{q[8],r} sphere{q[9],r} sphere{q[10],r} sphere{q[11],r} sphere{q[12],r} sphere{q[13],r} sphere{q[14],r} sphere{q[15],r} sphere{q[16],r} sphere{q[17],r} sphere{q[18],r} sphere{q[19],r} sphere{q[20],r} sphere{q[21],r} sphere{q[22],r} sphere{q[23],r} texture {T_Gold_1A} }