// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 1.0, 1.0, 1.0 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.50, 0.50, 0.50 > } finish{ diffuse 0.8 ambient 0.1 specular 5.8 roughness 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.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.42, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #macro mcpt() #declare cabeca = cylinder{ < 0, 0, 5.0 >, < 0, 0, +7.0 >, 1.0 texture { pigment {color rgb <0.64, 0.16, 0.16> }} } #declare olho = sphere { <0.8,0,6.7> , 0.13 } #declare nariz = sphere { <0.9,0,6.0>, 0.2 } #declare tronco = cylinder{ < 0, 0, 0.0 >, < 0, 0, +4.0 >, 2.0 texture { pigment {color rgb <0.64, 0.16, 0.16> } } } #declare pesc = cylinder{ < 0, 0, 4.0 >, < 0, 0, 5.0 >, 0.4 texture { pigment {color rgb <0.64, 0.16, 0.16> }} } union { object { cabeca } object { tronco } object { pesc } object { nariz } object { olho translate <0, -0.5, 0>} object { olho translate <0, 0.5, 0>} } #end #macro mpeh(n) #declare peh = box { <-0.9, -0.8, -0.02>, <0.9, 0.8, 0.02> texture { pigment {color rgb <0.64, 0.16, 0.16> }} } object { peh rotate <0, n, 0> } #end #macro anteperna(aa, ap) #declare c1 = cylinder{ < 0, 0, 0 >, < 0, 0, -3.0>, 0.25 } union { object { c1 rotate } object { mpeh(ap) translate < 0, 0, -3> rotate } } #end #macro perna(ap, aap, ap) #declare c1 = cylinder{ < 0, 0, 0 >, < 0, 0, -4.0>, 0.3 texture { pigment {color rgb <0.64, 0.16, 0.16> }} } union { object { c1 rotate } object { anteperna(aap, ap) translate <0, 0, -4> rotate } } #end #macro antebrac(n) #declare c1 = cylinder{ < 0, 0, 0 >, < 0, 0, -1.5>, 0.25 } #declare mao = sphere{ < 0, 0, -2.0 >, 0.5 texture{ pigment { color rgb <0,1,0> } } } union { object { c1 rotate } object { mao rotate } } #end #macro braco(ab, aa) #declare cil = cylinder{ < 0, 0, 1.5 >, < 0, 0, 0 >, 0.5 texture { pigment {color rgb <0.74, 0.26, 0.26> }} } union { object { antebrac(aa) rotate } object { cil rotate } } #end #declare caixa = box{ < -2.00, +2.00, -1.00 >, < +2.00, -2.00, +1.00 > texture {tx_vidro} } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui está a cena, finalmente: #macro boneco(bracD, antebracD, pernaD, antepernaD, pehD, bracE, antebracE, pernaE, antepernaE, pehE) union { object{ eixos(3.00) } object { mcpt() } object { braco(bracE, antebracE) translate <0, -2.5, 3> } object { braco(bracD, antebracD) translate <0, 2.5, 3> } object { perna(pernaE,antepernaE , pehE) translate <0, -1.8, 0>} object { perna(pernaD, antepernaD, pehD) translate <0, 1.8, 0>} } #end // CENA union { object{ chao translate < 0,0,-8 > texture{ tx_xadrez } } object { boneco(23, 82, 53, 54, 24, -37, -92, -23, -89, -40) translate <-2, -6, 0> } object { boneco(12, 12, 73, 24, 94, -37, 22, -63, -49, -80) translate < 0, 6, 0> } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 14.0; #declare dir_camera = < 34.00, 10.00, 14.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)