background{ color rgb < 1, 1, 1 > } #declare steel_1 = // aço texture{ pigment{ color rgb < 0.70, 0.70, 0.70 > } finish{ diffuse 0.5 ambient 0.1 brilliance 1 reflection 0.1 specular 0.2 roughness 0.5} } #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_2 = texture{ pigment{ color rgb < 0.30, 0.30, 0.30 > } finish{ diffuse 0.5 ambient 0.1 brilliance 1 reflection 0.15 specular 0.2 roughness 0.5} } #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 } #declare tx_4 = texture{ pigment{ color rgb < 0.25, 0.59, 0.04 > } finish{ diffuse 0.3 ambient 0.1 specular 0.5 roughness 1 } } #macro punho () #local tronco = cone { <0, 0, 0>, 0 // , center & radius of one end <0, 0, 1>, 0.3 // , center & radius of the other end } union { object {tronco texture {tx_2}} } #end #macro antebraco (c) #local tronco = cylinder { <0, 0, 0>, <0, 0, 1.5>, 0.4 // center of one end, center of other end, radius } #local pun = object{punho()} union { object{tronco texture {tx_xadrez}} object{pun rotate <0, c, 0> translate <0, 0, 1.5>} } #end #macro braco (b, c) #local tronco = cylinder { <0, 0, 0>, <0, 0, 2>, 0.4 // center of one end, center of other end, radius } #local ante = object{antebraco (c)} union { object{tronco texture {tx_4}} object{ante rotate <0, b, 0> translate <0, 0, 2>} } #end #macro cabeca () #local cabe = sphere { <0, 0, 0>, 1 // , radius } union { object{cabe texture {tx_xadrez}} } #end #macro subpescoco (c) #local tronco = cylinder { <0, 0, 0>, <0, 0, 0.6>, 0.4 // center of one end, center of other end, radius } #local cab = object{cabeca()} union { object{tronco texture {tx_2}} object{cab rotate <0, c, 0> translate <0, 0, 1.6>} } #end #macro pescoco (b1, b2, b3, c) #local tronco = cylinder { <0, 0, 0>, <0, 0, 1>, 0.4 // center of one end, center of other end, radius } #local sub = object{subpescoco (c)} union { object{tronco texture {tx_4}} object{sub rotate translate <0, 0, 1>} } #end #macro robo (E11, E12, E13, E14, E15, E21, E22, E23, E24, E25, D11, D12, D13, D14, D15, D21, D22, D23, D24, D25,P1, P2, P3, P4, P5, P6) #local corpo = box { <0, 0, 0>, <2, 4, 6> // near lower left corner, far upper right corner texture {tx_plastico} } #local perna_esquerda = object {braco(E14, E15) rotate translate <0, 0, 0> } #local perna_direita = object {braco(D14, D15) rotate translate <0, 4, 0> } #local braco_esquerdo = object {braco(E24, E25) rotate translate <2, 0, 6> } #local braco_direito = object {braco(D24, D25) rotate translate <2, 4, 6> } #local pesco = object {pescoco(P1, P2, P3, P4) rotate translate <1, 2, 6>} union { object {corpo} object {perna_esquerda} object {perna_direita} object {braco_esquerdo} object {braco_direito} object {pesco} } #end robo (10,225,0,20,5, 45,135,20,-90,45, 10,135,0,20,50, -45,135+90,20,-90,45, 20,0,0,90,45,90,) #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 20.0; #declare dir_camera = < 1.00, 1.00, 0.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)