// Last edited on 2023-12-25 16:54:20 by stolfi background{ color rgb < 0.75, 0.75, 0.85 > } #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 } } #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<0,A1,A4> } #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 #macro cena(tt) #local step = 3.1416 * 2 * tt; #local neck = 3.1416 * tt; object{robo(+cos(step)*45,-cos(step)*90,+cos(step)*45,30,30,30,-sin(step)*30,30,30,30,+sin(step)*30,30,30,30,+sin(step)*30,30,30,30,-sin(step)*30)} #end #include "eixos.inc" // object{ eixos(8) } object{ cena(clock) } #include "camlight.inc" #declare centro_cena = < 0, 3, -2 >; #declare raio_cena = 11.0; #declare dir_camera = < 7, 5, 3 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)