#include "metals.inc" #include "glass.inc" #include "colors.inc" #include "finish.inc" #declare VP = <4,4,4>; camera { location VP up y right x angle 60 sky <0,1,0> look_at <0,0,0> } global_settings { ambient_light rgb <1,1,1> } background { color rgb <1,1,1> } light_source { <5,10,0> color rgb <1,1,1> } #declare R1 = 2; #declare R2 = 0.75; #declare TORUS = torus { R1,R2 pigment { color rgb <0,1,0> } } #declare PLANE1 = plane { <0,1,0>, 0.6 pigment { color rgb <1,0,0> } } #declare PLANE2 = plane { <1,0,0>, 0 pigment { color rgb <1,0,0> } rotate <0,-20,0> } #declare LEN = sqrt(R1*R1 - R2*R2); #declare PLANE3 = plane { <1,0,0>, 0 pigment { color rgb <1,0,0> } rotate <0,0,90-degrees(atan2(R2,LEN))> } #switch (clock) #case (0) object { TORUS } #break; #case (1) intersection { object { TORUS } object { PLANE1 } } #break; #case (2) intersection { object { TORUS } object { PLANE2 } } #break; #case (3) intersection { object { TORUS } object { PLANE3 } } #break; #end