// Last edited on 2020-12-08 11:05:41 by jstolfi // Felipe Marinho Tavares // R.A.: 265680 // Unicamp - MC937A/MO603A – Computação Gráfica - 2020-S2 - Jorge Stolfi #version 3.6; // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare brown_soft_149_111_82 = color rgb < 149/255, 111/255, 82/255 >; #declare tx_woodish = texture{ pigment{ brown_soft_149_111_82 } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_redish = texture{ pigment{ color rgb < 255/255, 0/255, 0/255 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_gray70 = texture{ pigment{ color rgb <179/255, 179/255, 179/255> } } #declare tx_gray85 = texture{ pigment{ color rgb <217/255, 217/255, 217/255> } } #declare tx_gray90 = texture{ pigment{ color rgb <230/255, 230/255, 230/255> } } // ====================================================================== #macro robot(//right arm params ruarm_xtheta, ruarm_ytheta, ruarm_ztheta, rlarm_ytheta, rhand_xtheta, rhand_ytheta, rfinger1_theta, rfinger2_theta, rfinger3_theta, //left arm params luarm_xtheta, luarm_ytheta, luarm_ztheta, llarm_ytheta, lhand_xtheta, lhand_ytheta, lfinger1_theta, lfinger2_theta, lfinger3_theta) union{ cylinder{<0, 0, 0>, <0, 0, 10>, 5 texture{tx_gray85} } sphere{<0, 0, 10>, 5 texture { tx_gray85 } } sphere{<1.4, 0, 12>, 4 texture { tx_gray90 } } // right arm object{ upper_arm(rlarm_ytheta, rhand_xtheta, rhand_ytheta, rfinger1_theta, rfinger2_theta, rfinger3_theta) scale <0.45, 0.45, 0.45> rotate -90*y //default rotate 90*x //default rotate ruarm_xtheta*x rotate ruarm_ytheta*y rotate ruarm_ztheta*z translate <0, -5, 10> } // left arm object{ upper_arm(llarm_ytheta, lhand_xtheta, lhand_ytheta, lfinger1_theta, lfinger2_theta, lfinger3_theta) scale <0.45, 0.45, 0.45> rotate -90*y //default rotate 90*x //default rotate luarm_xtheta*x rotate luarm_ytheta*y rotate luarm_ztheta*z translate <0, -5, 10> scale <1, -1, 1> } } #end #macro upper_arm(larm_ytheta, hand_xtheta, hand_ytheta, finger1_theta, finger2_theta, finger3_theta) union{ box{<0, -2, -1.95>, <12, 2, 1.95> texture{tx_gray85}} object{ lower_arm(hand_xtheta, hand_ytheta, finger1_theta, finger2_theta, finger3_theta) rotate larm_ytheta*y translate <12, 0, 0> } } #end #macro lower_arm(hand_xtheta, hand_ytheta, finger1_theta, finger2_theta, finger3_theta) union{ box{<0, -0.55, -0.55>, <15, 0.55, 0.55> texture{tx_gray85}} object{ hand(finger1_theta, finger2_theta, finger3_theta) rotate hand_xtheta*x rotate hand_ytheta*y translate < 15, 0, 0 > } } #end #macro hand(finger1_theta, finger2_theta, finger3_theta) union{ box{<0, -1.5, -1>, <4, 1.5, 1> texture {tx_gray85}} box{<2, -2.5, -1>, <6, 2.5, 1> texture {tx_gray90}} object{ finger() //finger1 rotate -90*z //default rotate finger1_theta*x translate < 2 + 0.18, -2.5, 0> //default } object{ finger() //finger2 rotate finger1_theta*y translate < 6, -2.5 + 0.18, 0> //default } object{ finger() //finger3 rotate finger1_theta*y translate < 6, 2.5 - 0.18, 0> //default } } #end #macro finger() union{ box{<0, -0.18, -0.25>, <4.5, 0.18, 0.25> texture {tx_gray70}} } #end #include "eixos.inc" #local sep = 18*<+1,+1,00> ; // Deslocamnto entre robos. union{ //object{ eixos(20.00) translate <0, 0, 0> } object{ robot(0,120,70, -90, 0,0, 0,0,-70 0,120,30, -90, 0,-90, 0,-90,0) translate -sep } object{ robot(0,120,40, -40, 0,0, 0,0,-70 0,120,40, -40, 0,-40, 0,-40,0) } object{ robot(0,120,20, -20, 0,0, 0,0,-20 0,120,20, -20, 0,-20, 0,-20,0) translate +sep } } #include "camlight.inc" #declare centro_cena = < 6.00, 6.00, 6.00 >; #declare raio_cena = 45.0; #declare dir_camera = < 25.00, -11.00, 9.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)