// POLAR / Cactus '00.02 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { max_trace_level 8 assumed_gamma 2.2 } light_source {<20000, 100000, -50000> color <1,1,1>} light_source {<-60000, -30000, -40000> color <0.3,0.5,0.3>} camera { location <0,0,-10000> angle 5.6 look_at <20, -20, 0> } #declare Rdg=100; //radius of arranging sphere //initialize the coordinates for mesh Cp(x,y,z,r) #declare Vmax=72; #declare Hmax=2*Vmax; #declare Cp=array[Hmax][Vmax+2][4] #declare V=0; #while (V } triangle { } #end //normal vector of the plar coordinates point #macro Vd (Ph,Pv) <(Cp[mod(Ph-1+Hmax,Hmax)][Pv][1]-Cp[Ph][Pv][1])*(Cp[Ph][Pv-1][2]-Cp[Ph][Pv][2])-(Cp[Ph][Pv-1][1]-Cp[Ph][Pv][1])*(Cp[mod(Ph-1+Hmax,Hmax)][Pv][2]-Cp[Ph][Pv][2]), (Cp[Ph][Pv-1][0]-Cp[Ph][Pv][0])*(Cp[mod(Ph-1+Hmax,Hmax)][Pv][2]-Cp[Ph][Pv][2])-(Cp[mod(Ph-1+Hmax,Hmax)][Pv][0]-Cp[Ph][Pv][0])*(Cp[Ph][Pv-1][2]-Cp[Ph][Pv][2]), (Cp[mod(Ph-1+Hmax,Hmax)][Pv][0]-Cp[Ph][Pv][0])*(Cp[Ph][Pv-1][1]-Cp[Ph][Pv][1])-(Cp[Ph][Pv-1][0]-Cp[Ph][Pv][0])*(Cp[mod(Ph-1+Hmax,Hmax)][Pv][1]-Cp[Ph][Pv][1])> #end //smooth_triangle of the surface #macro Trisd (Ph,Pv) #declare Ph1=mod(Ph-1+Hmax,Hmax); smooth_triangle { Vd(Ph,Pv) Vd(Ph1,Pv-1) Vd(Ph,Pv-1) } smooth_triangle { Vd(Ph1,Pv) Vd(Ph1,Pv-1) Vd (Ph,Pv) } #end //main #declare I=0; #while (I<2) #declare J=0; #while (J<2) //radius caliculation and the translation from polar to xyz coordinsates #declare V=0; #while (V} finish { reflection 0.3 ambient 0 phong 1 brilliance 1 diffuse 1 } } rotate <30,300,0> #if (I=1) translate <100,-220,0> #else translate <-50,80,400> #end #if (J=0) translate <-200,30,0> #else translate <200,70,400> #end no_shadow } #declare J=J+1; #end #declare I=I+1; #end background {color rgbt <0,0,0.2>}