// Reursive / Bars Structure '99.02 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1 global_settings { assumed_gamma 2.2 } camera { location <-3,-8,-5> angle 10.5 look_at <-0.45, -0.63, 0> } light_source { <50, 100, -50> color rgb <1,1,1> } light_source { <50, -80, -18> color rgb <1,1,1> } #declare Nx=6; #declare Data = array [Nx][2] { {90,-90},{90,0},{0,270},{90,90},{0,-90},{90,180} } #declare Unit = union { cylinder { <0,0,0>,<0,1,0>, 0.1 } sphere { <0,1,0> 0.1 } } #declare J=0; #while (J <3) #declare Unit = #declare Sc =1; #declare Xp =0; #declare Yp =0; #declare Zp =0; #if(J=0) merge { #else union { #end #declare I=0; #while (I < Nx) object {Unit rotate translate } #declare Xp =Sc*(Xp+sin(Data[I][0]*pi/180)*sin(Data[I][1]*pi/180)); #declare Yp =Sc*(Yp+cos(Data[I][0]*pi/180)); #declare Zp =Sc*(Zp+sin(Data[I][0]*pi/180)*cos(Data[I][1]*pi/180)); #declare I=I+1; #end #declare Sc=1/sqrt(Xp*Xp+Yp*Yp+Zp*Zp); scale Sc } #if(J=0) object { Unit pigment{ color rgbt <1,1,0,1>} finish { reflection 0.3 ambient 0.2 diffuse 0.2 phong 0.6 specular 0.2 brilliance 0.8 } no_shadow rotate z*90 } #end #declare J=J+1; #end object { Unit pigment{ color rgb <1,1,0> } finish { ambient 0.2 reflection 0.7 diffuse 0.2 phong 3 specular 2 brilliance 0.8 } no_shadow rotate z*90 } background { color <0.1,0,0.7> }