// TWIGS / Orange Eye '07.11 // by Tsutomu HIGO URL:http://www.asahi-net.or.jp/~nj2t-hg/ #version 3.6; global_settings { assumed_gamma 2.2 max_trace_level 6 } light_source {<1500, 1000, -3000> color <1, 1, 1>} camera { location <0, 100, 0> angle 65 look_at <-1, 0, 0> } #macro Dla15 (Nmax, Rds) #declare R1 = seed(6); #declare Texs = texture { pigment {color rgb <1, 1, 1>} finish { ambient .2 diffuse .5 reflection 0.3 specular 0.4 roughness 0.1 } } #declare Cp = array[Nmax][5] #declare Cp[0][0] = 0; // x of sphere's center #declare Cp[0][1] = 0; // z of sphere's center #declare Cp[0][2] = 0; // y of sphere's center #declare Cp[0][3] = 0; // Distanse of sphere's center #declare Cp[0][4] = 2*pi*rand(R1); // Angle of sphere's center sphere { 2*Rds texture {Texs} no_shadow } #declare Np = 1; #while (Np < Nmax) #declare Cp[Np][4] = 2*pi*rand(R1); #if (Np = 1) #declare Cp[Np][3] = 2; #declare Cp[Np][0] = Cp[Np][3]*cos(Cp[Np][4]); #declare Cp[Np][1] = Cp[Np][3]*sin(Cp[Np][4]); #declare Cp[Np][2] = 0; #declare Nsclose = 0; #else #declare Ns = Np-1; #while (Ns > 0) #declare Det = 0; #declare Adis = abs(Cp[Np][4]-Cp[Ns][4]); #if (Adis > pi) #declare Adis = 2*pi-Adis; #end #if (Cp[Ns][3]*sin(Adis/2) < 0.6) #declare Cp[Np][3] = Cp[Ns][3]*cos(Adis)+2*sin(acos(Cp[Ns][3]*sin(Adis)/2)); #declare Cp[Np][0] = Cp[Np][3]*cos(Cp[Np][4]); #declare Cp[Np][1] = Cp[Np][3]*sin(Cp[Np][4]); #declare Cp[Np][2] = 0; #declare Nsclose = Ns; #declare Det = 1; #declare Ns = 1; #end #declare Ns = Ns-1; #end #if (Det = 0) #declare Cp[Np][3] = 2; #declare Cp[Np][0] = Cp[Np][3]*cos(Cp[Np][4]); #declare Cp[Np][1] = Cp[Np][3]*sin(Cp[Np][4]); #declare Cp[Np][2] = 0; #declare Nsclose = 0; #end #end union { sphere { Rds*Np/Nmax} cylinder { Rds*Np/Nmax} texture {Texs} } #declare Np = Np+1; #end #end Dla15 (3000, 0.5) intersection { box {<-50, 0, -50> < 50, 50, 50>} sphere {<0, 0, 0> 45} interior { ior 1.25 fade_distance 2000 fade_power 1 caustics 1.0 } texture { pigment {color rgbt <1, 0.6, 0.3, 0.7>} finish { ambient .4 diffuse .5 reflection 1 specular 0.4 phong 0.8 roughness 0.1 } } } background {color rgb <0.1, 0, 0>}