// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-12-23 19:14:19 by stolfi // ====================================================================== // CORES E TEXTURAS #declare s = seed(1); background{ color rgb < 0.5, 0.5, 0.5 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRI��O DA CENA #macro bicho(p1,p2,p3,p4, e11,e12,e13,e14, e21,e22,e23,e24, d11,d12,d13,d14, d21,d22,d23,d24) #local tronco = cylinder { <0, 0, 0>, <-20, 0, 0>, 3 pigment {color rgb <1,1,0>}} union { object{tronco} object{cabeca(p1) rotate p2*x rotate p3*y rotate p4*z} object{perna(-e11,-e12) rotate -e13*y rotate -e14*z translate <-5,0,0>} object{perna(-e21,-e22) rotate -e23*y rotate -e24*z translate <-15,0,0>} object{perna(-d11,-d12) rotate -d13*y rotate -d14*z translate <-5,0,0> scale <1,-1,1>} object{perna(-d21,-d22) rotate -d23*y rotate -d24*z translate <-15,0,0> scale <1,-1,1>} } #end #macro cabeca(a1) #local rosto = sphere {<0, 0, 0>, 4 pigment {color rgb <0,1,1>} } #local nariz = cylinder {<0,0,0>, <0,0,2> 1 pigment {color rgb <1,0,0>}} #local olho = sphere {<0,0,0>, 1} union { object{rosto} object{nariz rotate a1*y translate<4,0,0>} object{olho translate<4,0,0> rotate <0, -45, 30>} object{olho translate<4,0,0> rotate <0, -45, -30>} } #end #macro perna(b1,b2) #local tronco = cylinder { <0, 0, 0>, <0, 8, 0>, 1 pigment {color rgb <0,0,1>}} #local sub = cylinder { <0, 0, 0>, <0, 8, 0>, 1 pigment {color rgb <1,0,0>}} union { object{tronco} object{sub rotate b1*x rotate b2*y translate <0,8,0>} } #end #declare D = 22; object{ bicho( 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s), 45*rand(s) ) } object{ bicho( 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40, 80*rand(s)-40 ) translate D*z } #declare cmin = -D * < 1, 1, 0.5 >; #declare cmax = +D * < 1, 1, 1.5 > - 0.5*D*x; #include "eixos.inc" // object{ eixos(D/2 + 1) } #include "gaiola.inc" // object{ gaiola(cmin,cmax) } #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmax-cmin); #declare dist_camera = 7*raio_cena; #include "camlight.inc" #declare dir_camera = < 7, 5, 6 >; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)