// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-09-30 19:57:13 by jstolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_vidro = texture{ pigment{ color rgb < 1, 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_plastico = texture{ pigment{ color rgb < 0.50, 0.90, 0.50 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 0.40, 0.01, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRI��O DA CENA #declare raio = 2.500; // Partes da cena: #declare bola = sphere{ < 0.00, 0.00, 0.00 >, raio texture{ tx_plastico } } #declare caixa = box{ <-1,-2,0>, <+1,2,1> texture{ tx_plastico }} #declare bolinha = sphere{ < 0, 0, 0 >, 1 texture{ tx_plastico } } #declare bolona = sphere{ < 0, 0, 0 >, 1.5 texture{ tx_plastico } } #declare tanque_cone = cone{ < 0, 0, 0 >, 1 < 0, 0, 3.00 >, 0.5 texture{ tx_plastico } } #include "eixos.inc" #macro perna(b1, b2, b3) #local tronco_perna = cylinder{ < 0.00, +0.00, 0.00 >, < 0.00, 0.00, -2.00 >, 0.5 texture{ tx_fosca } } #local canela_obj = canela(b3) union { object { tronco_perna } object { canela_obj rotate translate <0, 0, -2>} } #end #macro canela(b3) #local tronco_can = cylinder{ < 0.00, +0.00, 0.00 >, < 0.00, 0.00, -2.00 >, 0.5 texture{ tx_fosca } } #declare junta = sphere{ < 0, 0, 0 >, 0.75 texture{ tx_plastico } } union { object { tronco_can translate <0, 0, -1> } object { junta translate <0, 0, -3.5> } object { pata() rotate <0, b3, 0> translate <0, 0, -4>} object { junta translate <0, 0, -0.5> } } #end #macro pata() #local pata_box = box{ <-0.5,-1,0>, <0.5,1,-2> texture{ tx_fosca } } union { object { pata_box } } #end #macro cabeca() #local pescoco = cylinder{ < 0.00, +0.00, 0.00 >, < 0.00, 0.00, 3.00 >, 0.5 texture{ tx_fosca } } #declare topo = sphere{ < 0, 0, 0 >, 1.5 texture{ tx_plastico } } union { object { pescoco translate <0, 0, 0> } object { topo translate <0, 0, 3> } } #end #macro animal(b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16) #local tronco_corpo = box{ <-1,-2, -2>, <1, 2, 2> texture{ tx_plastico } } union { object { cabeca() translate <0, 0, 2> } object { tronco_corpo } object { perna(b1, b2, b3) rotate <90, b4, 0> translate <0, 2, 1.5> } object { perna(b5, b6, b7) rotate <90, b8, 0> scale <1.0, 1.0, -1.0> translate <0, 2, -1.5> } object { perna(b9, b10, b11) rotate <-90, b12, 0> translate <0, -2, 1.5> } object { perna(b13, b14, b15) rotate <-90, b16, 0> scale <1.0, 1.0, -1.0> translate <0, -2, -1.5> } } #end #declare PI = 3.14; #macro cena(tt) #declare volta = 360 * tt; #declare angulo_pata = sin(2 * PI * tt) * 40; #declare angulo_fechar = sin(2 * PI * tt) * 90; union { object { animal( angulo_pata, 0, 0, 0, 45, angulo_fechar, 0, 0, -angulo_pata, 0, 0, 0, -45, angulo_fechar, 0, 0 ) rotate <0, 0, volta> } } #end union{ object{ eixos(5.00) } object { cena(clock) } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 20; #declare dir_camera = < 7, 2, 5.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)