// 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_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } 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 #declare pino = cylinder{ < -2.00, +2.00, -1.00 >, < +2.00, -2.00, +1.00 >, 0.75 texture{ tx_fosca } } #declare cilindro1 = cylinder{ < 0, 0, 0 >, < +0.00, +1.00, +0.00 >, .3 texture{ tx_fosca } } #declare cilindro2 = cylinder{ < 0, 0, 0 >, < +0.00, +1.00, +0.00 >, .27 texture{ tx_fosca } } #declare cilindro3 = cylinder{ < 0, 0, 0 >, < +0.00, +1.00, +0.00 >, .25 texture{ tx_fosca } } #declare maoEsquerdaInferior= cylinder{ < 0, 0, 0 >, < +0.00, +1.00, +0.00 >, .1 texture{ tx_fosca } } #declare maoEsquerdaSuperior= cylinder{ < 0, 0, 0 >, < +0.00, +1.00, +0.00 >, .1 texture{ tx_fosca } } #declare maoDireitaInferior= cylinder{ < 0, 0, 0 >, < +0.00, +1.00, +0.00 >, .1 texture{ tx_fosca } } #declare maoDireitaSuperior= cylinder{ < 0, 0, 0 >, < +0.00, +1.00, +0.00 >, .1 texture{ tx_fosca } } #declare esfera = sphere{ < +0.00, +0.00, +0.00 >, .25 texture{ tx_fosca } } #declare esferaMini = sphere{ < +0.00, +0.00, +0.00 >, .2 texture{ tx_fosca } } #declare articulacao = box{ <0.00, 0.00, 0.00>, <1.00, 1.00, 1.00> } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro garraBiscoito( angulo ) union { object{cilindro1 rotate<90,0,0>} object{cilindro2 rotate<90,0,0> translate<0,0,1>} object{cilindro3 rotate<90,0,0> translate<0,0,2>} object{esfera translate<0,0,3>} object{esferaMini translate<0,sin(45),3+sin(45)>} object{esferaMini translate<0,-sin(45),3+sin(45)>} object{maoEsquerdaInferior rotate<135,0,0> translate<0,0,3>} object{maoEsquerdaSuperior rotate<135 - angulo,0,0> translate<0,sin(45),3+sin(45)>} object{maoDireitaInferior rotate<45,0,0> translate<0,0,3>} object{maoDireitaSuperior rotate<45 + angulo,0,0> translate<0,-sin(45),3+sin(45)>} } #end /* */ #declare pontaPe = box{ <0.00, 0.00, 0.00>, <1.00, 1.00, 1.00> } #declare corpoPe = box{ <0.00, 0.00, 0.00>, <2.00, 1.00, 1.00> } #declare canelaBota = box{ <0.00, 0.00, 0.00>, <1.25, 1.25, 2.5> } #declare pernaBota = box{ <0.00, 0.00, 0.00>, <1.4, 1.4, 2> texture{ tx_fosca } } #declare articulacaoPe = sphere{ < +0.00, +0.00, +0.00 >, .6 texture{ tx_fosca } } #declare articulacaoPerna = sphere{ < +0.00, +0.00, +0.00 >, .7 texture{ tx_fosca } } #declare articulacaoJoelho = sphere{ < +0.00, +0.00, +0.00 >, 1 texture{ tx_fosca } } #declare ombro = sphere{ < +0.00, +0.00, +0.00 >, .5 } #declare braco= box{ <0.00, 0.00, 0.00>, <0.5, 0.5, -1.> texture{ tx_fosca } } #declare cotovelo= sphere{ < +0.00, +0.00, +0.00 >, .3 } #declare antebraco= box{ <0.00, 0.00, 0.00>, <0.6, 0.6, -1> texture{ tx_fosca } } #declare cranio= sphere{ < +0.00, +0.00, +0.00 >, 1.5 texture{ tx_fosca } } #macro pontaPeMacro() union { object{ pontaPe translate<0,-.5,-.5>} object { articulacaoPe } } #end #macro peitoPeMacro() union { object { articulacaoPerna translate<0,0,0>} object { corpoPe translate<.25,-.5,-.5>} object { pontaPeMacro() translate<2.5,0,0>} } #end #macro canelaMacro() union { // object { canelaBota translate<-3,0,0>} // object { articulacaoJoelho translate<-2.5,.5,3> } object { canelaBota translate<-.5,-.5,-3>} object { articulacaoJoelho translate<0,0,0> } object { peitoPeMacro() translate<1,0,-3> } } #end #macro botaMacro() union { object { pernaBota translate<0,0,0>} object { canelaMacro() translate<.5,.5,0>} } #end #macro antebracoMacro() union { object { #cotovelo } // cotovelo esquerdo object { #antebraco translate<-.3,-.3,-.25> } } #end #macro bracoEsquerdoMacro() union { //object { #cotovelo translate<-2.5,2,3.25> } // cotovelo esquerdo object { #ombro } // cotovelo esquerdo object { #braco translate<-.25,-.25,-.25> } object { #antebracoMacro() translate<0,0,-1.25> } } #end #macro bracoDireitoMacro() union { //object { #cotovelo translate<-2.5,2,3.25> } // cotovelo esquerdo object { #ombro } // cotovelo esquerdo object { #braco translate<-.25,-.25,-.25> } object { #antebracoMacro() translate<0,0,-1.25> } } #end #macro corpo() union { object{ #botaMacro()} object{ #bracoEsquerdoMacro() translate<1,1.75,1.5>} object{ #bracoDireitoMacro() translate<1,-0.5,1.5>} } #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ /* O angulo de abertura deve variar entre 0 e 45(0 fechada e 45 aberta) */ object {corpo()} } /* object{ chao translate < 0,0,-5 > texture{ tx_xadrez }} object{ pontaPe } object { articulacaoPe translate<0,.5,.5>} object { corpoPe translate<-1.5,0,0>} object { articulacaoPerna translate<-1.75,.5,.5>} object { canelaBota translate<-3,0,0>} object { articulacaoJoelho translate<-2.5,.5,3> } object { pernaBota translate<-3,-0.0,3>} object { #ombro translate<-2.5,1.75,4.25> } // ombro esquerdo object { #braco translate<-2.8,1.75,4.25> } object { #cotovelo translate<-2.5,2,3.25> } // cotovelo esquerdo object { #antebraco translate<-2.8,1.75,3.25> } */ /* union{ object{ eixos(3.00) } object{ bolota translate < -2,+1,+3 > texture{ tx_espelho } } object{ bolinha translate < +5,+4,+2 > texture{ tx_vidro } interior { ior 1.01 } } difference{ union{ object{ bola } object{ pino } } object{ furo } } } */ /* #macro coisa(A,B,C) #end */ #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena =10.0; #declare dir_camera = <10.00, -5.00,5 >; #declare dist_camera = 5.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)