// Reursive / Zigzags 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 < 0,0,-30 > angle 3 look_at < 0.6,0.324,0 > } light_source { <50, 100, -50> color rgb <1,1,1> } light_source { <50, -80, -18> color rgb <1,1,1> } #declare Data = array [6][2] { {60,50},{70,130},{60,170},{70,250},{60,310},{70,5} } #declare Unit = union { cylinder { <0,0,0>,<0,1,0>, 0.15 } sphere { <0,1,0> 0.15 } } #declare J=0; #while (J < 5) #declare Unit = #declare Sc =1; #declare Xp =0; #declare Yp =0; #declare Zp =0; union { #declare I=0; #while (I < 6) 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 rotate y*180/pi*asin(Zp/sqrt(Zp*Zp+Xp*Xp)) rotate z*180/pi*acos(Yp/sqrt(Xp*Xp+Yp*Yp+Zp*Zp)) } object { Unit pigment{ color rgbt < 0,J*0.4,0.9-J*0.3,0.9-J*0.3 >} no_shadow rotate<90,90,0> } #declare J=J+1; #end background { color <1,1,1> }