// 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 < 0.75, 0.80, 0.85 > } #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_money = texture{ pigment{ color rgb < 0, 1, 0 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_tronco = texture{ pigment{ color rgb <1, 0.7, 0.7 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca = texture{ pigment{ color rgb < 0.7, 0.1, 0.2 > } finish{ diffuse 0.1 reflection 0.7*< 0.7, 0.1, 0.2 > 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 #declare raio = 5.000; // Partes da cena: #declare esferaCabeca = sphere{ < 0, 0, 0 >, 1 scale < 1,1.7,1> texture{ tx_tronco } } #declare esferaNariz = sphere{ < 0.85, 0, 0.2 >, 0.2 scale < 1,1.4,1> texture{ tx_tronco } } #declare esferaOlhoDireito = sphere{ < 0.8, -0.7, 0.4 >, 0.3 texture{ tx_tronco } } #declare esferaOlhoEsquerdo = sphere{ < 0.8, 0.7, 0.4 >, 0.3 texture{ tx_tronco } } #declare esferaOrelhaEsquerda = sphere{ < 0, -0.5, 0.3 >, 0.4 scale < -0.5,1,2> texture{ tx_tronco } } #declare esferaOrelhaDireita = sphere{ < 0, 0.5, 0.3 >, 0.4 scale < -0.5,1,2> texture{ tx_tronco } } #macro criaCabeca() union{ difference{ object{esferaCabeca} object{esferaOlhoDireito} object{esferaOlhoEsquerdo} } object{esferaNariz} object{esferaOrelhaEsquerda} object{esferaOrelhaDireita} } translate <0,0,3.3> #end #declare cilindroCorpo = cone{<0,0,0>,1,<0,0,2>,0.8 texture{ tx_tronco } } #declare esferaCorpoCabeca = sphere{ < 0, 0, 2 >, 0.8 texture{ tx_tronco } } #declare esferaCotovelo = sphere{ < 0, 0, 0 >, 0.3 texture{ tx_tronco } } #declare coneAntebraco = cone{<0,0,0>,0.3,<0,0,-1>,0.6 texture{ tx_tronco } } #declare esferaOmbro = sphere{ < 0, 0, 0 >, 0.3 texture{ tx_tronco } } #declare coneBraco = cylinder{ < 0,0,0 >, < 0,0,-1 >, 0.3 texture{ tx_tronco } } #macro criaAnteb() union{ object{esferaCotovelo} object{coneAntebraco} } #end #macro criaBraco(ante) union{ object{esferaOmbro} object{coneBraco} object{criaAnteb() rotate -ante*y translate<0,0,-1>} } #end #macro criaPe() union{ object{quadradoPe} object{esferaPe} } #end #macro criaPerna(pe) union{ object{esferaPerna} object{conePerna} object{criaPe() rotate pe*y translate<0,0,-0.5>} } #end #macro criaCoxa(pe,perna) union{ object{esferaJoelho} object{coneCoxa} object{criaPerna(pe) rotate perna*y translate <0,0,-0.5>} } #end #macro criaCorpo(anteD,anteE,bracoD,bracoE,peD,peE,pernaD,pernaE,coxaD,coxaE) union{ object{cilindroCorpo} object{esferaCorpoCabeca} object{criaBraco(anteD) rotate bracoD*x translate<0,1,2>} object{criaBraco(anteE) rotate -bracoE*x translate<0,-1,2>} object{criaCoxa(peE,pernaE) rotate coxaE*y translate<0,-0.7,-0.45>} object{criaCoxa(peD,pernaD) rotate coxaD*y translate<0,0.7,-0.45>} } #end #macro criaGato(a,b,c,d,e,f,g,h,i,j) union{ object{criaCabeca()} object{criaCorpo(a,b,c,d,e,f,g,h,i,j)} } #end #declare quadradoPe = box { <0,0,0>,<1,1,0.4> texture{ tx_tronco } translate <0,-0.5,-0.2> } #declare esferaPe = sphere{ < 0, 0, 0 >, 0.5 texture{ tx_tronco } } #declare coneCoxa = cylinder{ < 0,0,0 >, < 0,0,-0.5 >, 0.5 texture{ tx_tronco } } #declare esferaJoelho = sphere{ < 0, 0, 0 >, 0.5 texture{ tx_tronco } } #declare conePerna = cylinder{ < 0,0,0 >, < 0,0,-0.5 >, 0.5 texture{ tx_tronco } } #declare esferaPerna = sphere{ < 0, 0, 0 >, 0.5 texture{ tx_tronco } } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui está a cena, finalmente: object{ eixos(3.00) } object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } //anteD,anteE,bracoD,bracoE,peD,peE,pernaD,pernaE,coxaD,coxaE object{criaGato(45,30,45,70,30,-15,30,50,45,-30)} object{criaGato(60,20,90,90,30,30,30,45,0,45) rotate 30*z translate<0,5,0>} #include "camlight.inc" #declare centro_cena = < 0.00, 2, 2 >; #declare raio_cena = 10.0; #declare dir_camera = < 13,-2,4 >; #declare dist_camera = 20; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)