// Last edited on 2013-12-11 09:20:45 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.0, 0.0, 0.22 > } #declare tx_polvo = texture { pigment { color rgb < 0.44, 0.22, 0.33 > } finish { diffuse 0.8 ambient 0.1 specular 0.0 roughness 0.05 } } #declare num_bolas = 20; #declare bola = sphere { < 0, 0, 0 > 1 texture { tx_polvo } } #macro interpolar(p0, p1, tt) ((1-tt)*p0+tt*p1) #end #macro bezier(p0, dp0, p3, dp3, tt) #local p01=interpolar(p0, p0+dp0, tt); #local p12=interpolar(p0+dp0, p3-dp3, tt); #local p23=interpolar(p3-dp3, p3, tt); #local p012=interpolar(p01, p12, tt); #local p123=interpolar(p12, p23, tt); interpolar(p012, p123, tt) #end #macro tentaculo(base, d_base, meio, d_meio, ponta, d_ponta, raio_base, raio_ponta) union { #local tt=0; #while (tt<=1) object { bola scale bezier(raio_base, 0, raio_ponta, 0, tt/2) translate bezier(base, d_base, meio, d_meio, tt) } #local tt=tt+1/(num_bolas-1); #end #local tt=0; #while (tt<=1) object { bola scale bezier(raio_base, 0, raio_ponta, 0, 0.5+tt/2) translate bezier(meio, d_meio, ponta, d_ponta, tt) } #local tt=tt+1/(num_bolas-1); #end } #end #macro polvo(num_tentaculos, modelo) #local aleatorio = seed(modelo); union { object { tentaculo(< 0, 0, 0 >, < 0, 0, 0.1 >, < 0, 0, 0.2 >, < 0, 0, 0.5 >, < 0, 0, 1.2 >, < 0, 0, 0.1 >, 5/num_tentaculos, 7/num_tentaculos) } #local i = 1; #while (i <= num_tentaculos) object { tentaculo(< 0, 0, 0 >, < 0, 1, rand(aleatorio) >, < 0, 1 + rand(aleatorio)*2, 0 >, < 0, 1, rand(aleatorio)*2 - 1 >, < 0, 5, 0 >, < 0, 1, -rand(aleatorio) >, pi/(num_tentaculos), pi/(2*num_tentaculos)) translate < 0, 1, 0 > rotate < 0, 0, i * 360 / num_tentaculos > } #local i = i + 1; #end } #end #declare pos_polvo = < 0, 0, 0 >; union{ object { polvo(8, 15654) translate pos_polvo } } #include "camlight.inc" #declare centro_cena = pos_polvo; #declare raio_cena = 8; #declare dir_camera = < 0.5, -1, 0.3 >; #declare dist_camera = 100.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)