// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-12-24 17:36:27 by stolfi // ====================================================================== // Declarações essenciais background{ color rgb < 0.75, 0.75, 0.85 > } // ====================================================================== // Texturas #declare tx_cinza = texture{ pigment{ color rgb < 0.80, 0.80, 0.80 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== // Formas // ====================================================================== // Macros #macro robo(P1,P2,P3,E11,E12,E13,E14,D11,D12,D13,D14,E21,E22,E23,E24,D21,D22,D23,D24) union{ object{cylinder{<0,0,0>,<0,6,0>, 1 texture{tx_cinza}}} object{pesco(P1,P2,P3) translate<0,6,0>} object{braco(E21,E22,E23,E24) translate<1,0.5,0>} object{braco(E11,E12,E13,E14) translate<1,5.5,0>} object{braco(D21,D22,D23,D24) translate<1,0.5,0> scale<-1,1,1>} object{braco(D11,D12,D13,D14) translate<1,5.5,0> scale<-1,1,1>} } #end #macro braco(A1,A2,A3,A4) union{ object{subbraco(A2, A3) translate <3, 0, 0>} object{cylinder{<0,0,0>,<3,0,0>, 0.5 texture{tx_cinza}}} rotate } #end #macro subbraco(A2,A3) union{ object{mao(A3) translate <2.5, 0, 0>} object{cylinder{<0,0,0>,<2,0,0>, 0.5 texture{tx_cinza}}} rotate<0,A2,0> } #end #macro mao(A3) union{ sphere{<0,0,0>, 0.5 texture{tx_cinza}} cylinder{<0,-0.4,0>,<2,-0.5,0>, 0.1 texture{tx_cinza}} cylinder{<0,0.00,0>,<2,0.00,0>, 0.1 texture{tx_cinza}} cylinder{<0,+0.4,0>,<2,+0.5,0>, 0.1 texture{tx_cinza}} rotate <0, A3, 0> // } #end #macro pesco(P1,P2,P3) union{ object{subpesco(P2,P3) translate <0, 2, 0>} object{cylinder{<0,0,0>,<0,2,0>, 0.3 texture{tx_cinza}}} rotate<0,0,P1> } #end #macro subpesco(P2,P3) union{ object{cabeca(P3) translate <0, 2, 0>} object{cylinder{<0,0,0>,<0,2,0>, 0.3 texture{tx_cinza}}} rotate<0,0,P2> } #end #macro cabeca(P3) object{box{<-1,0,-0.25>, <+1,+0.5,+0.25> texture{tx_cinza}} rotate <0,0,P3>} #end // ====================================================================== //Render #declare DX = 9; #declare DY = 7; #declare DZ = 7; object{ robo ( -45,+45,30, 30,30,30,0, 30,30,30,0, 30,30,30,-0, 30,30, 30,-0 ) translate -DX*x } object{ robo ( +45, -70, -20, +70, +90, +80, +25, -40, +50, +50, 0, +70, +20, -90, 0, +70, +20, -90, 0 ) translate +DX*x } #declare cmin = < -2*DX, -DY+5, -DZ >; #declare cmax = < +2*DX, +DY+5, +DZ-3 >; #include "gaiola.inc" // object{ gaiola(cmin,cmax) } #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.50*vlength(cmax-cmin); #declare dist_camera = 7*raio_cena; #include "camlight.inc" #declare dir_camera = < 5, 7, 3 >; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)