// Persistence Of Vision raytracer version 3.5 sample file. // //This file contains geometry descriptions for some object modifiers //demo scenes. //some macros first... //box made of square rods #macro BarBox (StartPoint,EndPoint,Thick) #declare SmallCorner=; #declare BigCorner=; #declare Amplitude=BigCorner-SmallCorner; union { box {<0,0,0>,} box {<0,Amplitude.y,0>,} box {<0,0,Amplitude.z>,} box {<0,Amplitude.y,Amplitude.z>,} box {<0,0,0>, translate 0} box {<0,0,0>, translate } box {<0,0,0>, translate <0,0,Amplitude.z-Thick>} box {<0,0,0>, translate } box {0,} box {0, translate } box {0, translate <0,Amplitude.y-Thick,0>} box {0, translate } translate SmallCorner } #end //box with round corners #macro RoundedBox(v_SP,v_EP,R) union { #local vSP=(v_SP)*<1,1,1>; #local vEP=(v_EP)*<1,1,1>; #if (vSP.x > vEP.x) #local tSave=vSP.x; #local vSP=; #local vEP=; #end #if (vSP.y > vEP.y) #local tSave=vSP.y; #local vSP=; #local vEP=; #end #if (vSP.z > vEP.z) #local tSave=vSP.z; #local vSP=; #local vEP=; #end box {,} box {,} box {,} #local vSP=vSP+R; #local vEP=vEP-R; sphere { ,R} sphere { ,R} sphere { ,R} sphere { ,R} sphere { ,R} sphere { ,R} sphere { ,R} sphere { ,R} cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } cylinder { ,,R } } #end //pyramid #macro Pyramid (Nbfaces,Apot,Height) #declare RotAngle=(360/Nbfaces); #declare AngHeight=degrees(atan2(Apot/Height,1)); #declare Loop=0; intersection { #while (Loop < Nbfaces) plane {x,0 rotate z*AngHeight translate x*Apot rotate y*RotAngle*Loop} #declare Loop=Loop+1; #end plane {y,0 inverse} } #end //the thingy ! #declare Thingy = union { object {Pyramid (6,30,55)} object {BarBox (<-40,0,-10>,<70,60,20>,3)} object {RoundedBox (<10,0,-10>,<-30,80,-50>,5)} sphere {<70,10,50>,10} box {<-20,0,40>,<40,40,120>} object {RoundedBox (<0,0,60>,<-30,70,75>,3)} cylinder {<0,0,0>,<0,0,80>,1 translate <-5,81,-30>} cylinder {<0,0,0>,<0,0,80>,1 translate <-10,81,-30>} union { cone {<0,0,0>,10,<0,60,0>,1} torus {8,1 translate y*50} torus {8,1 translate y*45} translate <90,0,-20> } }