// POLAR / Flower '00.02 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { max_trace_level 9 assumed_gamma 2.2 } light_source {<500, 1000, -2000> color <0.5,0.5,1>} light_source {<-6000, -3000, -4000> color <0.54,1,0.5>} camera { location <0,0,-10000> angle 58 look_at <-400, 600, 0> } #declare Rdg=100; //basic radius of sphere //initialize the coordinates for mesh Cp(x,y,z,r) #declare Vmax=144; #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 //radius caliculation and the translation from polar to xyz coordinsates #declare V=0; #while (V} finish { reflection 1 ambient -0.20 phong 1 brilliance 1 diffuse 1 } } rotate <70,40,0> no_shadow }