// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2021-12-11 15:19:34 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.5, 0.5, 1 > } #declare tx_dirt = texture{ pigment{ color rgb < 0.2, 0.2, 0.2 > } finish{ diffuse 0.8 reflection 0.25 ambient 0.0 specular 0.5 roughness 0.1} } #declare tx_trunk = texture{ pigment{ color rgb < 0.5, 0.2, 0.1 > } finish{ diffuse 0.8 ambient 0.0 specular 0.5 roughness 0.8} normal { bumps 1 scale .05 } } #declare tx_leaf = texture{ pigment{ color rgb < 0.4, 1, 0.2 > } finish{ diffuse 0.8 ambient 0.0 specular 0.5 roughness 0.5} } #declare tx_ground = texture{ pigment{ color rgb < 0.7, 0.6, 0.2 > } finish{ diffuse 0.8 ambient 0.2} normal { bumps 0.1 scale 1 } } #declare tx_clank_dark_gray = texture{ pigment{ color rgb < 0.1, 0.1, 0.1 > } finish{ diffuse 0.8 specular 0.5 roughness 0.1} } #declare tx_clank_light_gray = texture{ pigment{ color rgb < 0.5, 0.5, 0.5 > } finish{ diffuse 0.8 specular 0.5 roughness 0.1} } #declare tx_clank_mid_gray = texture{ pigment{ color rgb < 0.2, 0.2, 0.2 > } finish{ diffuse 0.8 specular 0.5 roughness 0.1} } #declare tx_eye = texture{ pigment{ color rgb < 1, 0.2, 0.2 > } finish{ diffuse 1 ambient 0.5 specular 0.5 roughness 0.1} } #declare tx_fire = texture{ pigment{ color rgb < 1.000, 0.650, 0.200 > } finish{ diffuse 0.1 ambient 0.9 } } #declare tx_fire_red= texture{ pigment{ color rgb < 1.000, 0.450, 0.200 > } finish{ diffuse 0.1 ambient 0.9 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 1 specular 0.25 roughness 0.005 } } // ====================================================================== // DESCRICAO DA CENA #declare ground = box{ <-400,-400,-1>, <+400,+400,0> texture{ tx_ground } } #macro clank_chin(head_angle) object{ union{ difference { sphere { <0, 0, 0>, 0.05 // , radius texture{ tx_clank_light_gray} scale <1,1,1.2> } box { <2, 2, 2>, <-1,-1, 0.0> // near lower left corner, far upper right corner texture{ tx_clank_dark_gray} } } // neck cylinder { <0, 0, -0.04>, <0, 0, -0.09>, 0.01 // center of one end, center of other end, radius texture{ tx_clank_dark_gray} } object { clank_forehead() rotate <0, -head_angle, 0> translate <-0.05,0, 0> } } translate <0, 0, 0.05*1.2> // } #end #macro clank_forehead() object { union { difference { sphere { <0, 0, 0>, 0.05 // , radius texture{ tx_clank_light_gray} scale <1,1,1.2> } box { <-2, -2, -2>, <2,2, 0.0> // near lower left corner, far upper right corner texture{ tx_clank_dark_gray} } } // Eye Right cylinder { <0, 0.025, 0.025>, <0.05, 0.025, 0.025>, 0.015 // center of one end, center of other end, radius texture{ tx_clank_mid_gray} } sphere { <0.05, 0.025, 0.025>, 0.013 // , radius texture{ tx_eye} } // Eye Left cylinder { <0, -0.025, 0.025>, <0.05, -0.025, 0.025>, 0.015 // center of one end, center of other end, radius texture{ tx_clank_mid_gray} } sphere { <0.05, -0.025, 0.025>, 0.013 // , radius texture{ tx_eye} } } translate <0.05, 0, 0> } #end #macro clank_top_falange() object{ union { box { <-0.0095, 0, -0.005>, <0.0095, 0.01, 0.005> // near lower left corner, far upper right corner texture{ tx_clank_dark_gray} } box { <-0.01, 0.01, -0.005>, <0.01, 0.02, 0.005> // near lower left corner, far upper right corner texture{ tx_clank_mid_gray} } } } #end #macro clank_bot_falange(top_falange_angle) object{ // create finger middle union { box { <-0.0095, 0, -0.005>, <0.0095, 0.01, 0.005> // near lower left corner, far upper right corner texture{ tx_clank_dark_gray} } box { <-0.01, 0.01, -0.005>, <0.01, 0.02, 0.005> // near lower left corner, far upper right corner texture{ tx_clank_mid_gray} } // append top falange object { clank_top_falange() rotate // translate <0, 0.02, 0> // } } } #end #macro clank_hand(thumb_bot_falange_angle, thumb_top_falange_angle, f1_bot_falange_angle, f1_top_falange_angle, f2_bot_falange_angle, f2_top_falange_angle) object{ union { // create hand object { box { <-0.02, 0, -0.005>, <0.02, 0.04, 0.005> // near lower left corner, far upper right corner texture{ tx_clank_light_gray} } } // append fingers object{ union { // Finger 1 object { clank_bot_falange(f1_top_falange_angle) rotate // translate <-0.01, 0.04, 0> // } // Finger 2 object { clank_bot_falange(f2_top_falange_angle) rotate // translate <0.01, 0.04, 0> // } // Thumb object { clank_bot_falange(thumb_top_falange_angle) scale <1.1, 0.5, 1> rotate // translate <0.02, 0.01, 0> // } } } } } #end #macro clank_forearm(hand_angle, thumb_bot_falange_angle, thumb_top_falange_angle, f1_bot_falange_angle, f1_top_falange_angle, f2_bot_falange_angle, f2_top_falange_angle) object{ union { // create forearm object { union{ cylinder { <0, 0, -0.0045>, <0, 0, 0.0045>, 0.006 // center of one end, center of other end, radius texture{ tx_clank_light_gray} } cylinder { <0, 0, -0.0055>, <0, 0, 0.0055>, 0.005 // center of one end, center of other end, radius texture{ tx_clank_dark_gray} } cylinder { <0, 0, 0>, <0, 0.03, 0>, 0.004 // center of one end, center of other end, radius texture{ tx_clank_dark_gray} } } } // append fingers object{ // hand object { clank_hand( thumb_bot_falange_angle, thumb_top_falange_angle, f1_bot_falange_angle, f1_top_falange_angle, f2_bot_falange_angle, f2_top_falange_angle ) rotate // translate <0, 0.028, 0> // } } } } #end #macro clank_arm(forearm_angle, hand_angle, thumb_bot_falange_angle, thumb_top_falange_angle, f1_bot_falange_angle, f1_top_falange_angle, f2_bot_falange_angle, f2_top_falange_angle) object{ union { // create arm object { union{ // ombrera cylinder { <0, 0, -0.005>, <0, 0, 0.005>, 0.015 // center of one end, center of other end, radius texture{ tx_clank_light_gray} } cylinder { <0, 0, 0.005>, <0, 0, 0.02>, 0.004 // center of one end, center of other end, radius texture{ tx_clank_dark_gray} } cylinder { <0, 0, 0>, <0, 0.03, 0>, 0.004 // center of one end, center of other end, radius translate <0, 0.015, 0> // texture{ tx_clank_dark_gray} } } } // append fingers object{ union { // hand object { clank_forearm( hand_angle, thumb_bot_falange_angle, thumb_top_falange_angle, f1_bot_falange_angle, f1_top_falange_angle, f2_bot_falange_angle, f2_top_falange_angle ) rotate <0, 0, -forearm_angle> // translate <0, 0.045, 0> // } } } } } #end #macro clank_propulsor() object { union { cone { <0, 0, 0>, 0.03 // , center & radius of one end <0, 0.01, -0.09>, 0 // , center & radius of the other end texture{ tx_fire} } cone { <0, 0, 0>, 0.03 // , center & radius of one end <0.01, 0, -0.09>, 0 // , center & radius of the other end texture{ tx_fire} } cone { <0, 0, 0>, 0.03 // , center & radius of one end <0, -0.01, -0.09>, 0 // , center & radius of the other end texture{ tx_fire} } cone { <0, 0, 0>, 0.03 // , center & radius of one end <-0.01, 0, -0.09>, 0 // , center & radius of the other end texture{ tx_fire} } cone { <0, 0, 0>, 0.038 // , center & radius of one end <0, 0, -0.1>, 0 // , center & radius of the other end texture{ tx_fire_red} } } } #end #macro robo_vec(PA) clank_body( PA[0], PA[1], PA[2], PA[3], PA[4], PA[5], PA[6], PA[7], PA[8], PA[9], PA[10], PA[11], PA[12], PA[13], PA[14], PA[15], PA[16], PA[17], PA[18], PA[19], PA[20], PA[21], PA[22], PA[23] ) #end #macro clank_body(prop_rot, prop_trans, mouth_angle, head_angle, arm_angle1_right, arm_angle_2_right, forearm_angle_right, hand_angle_right, thumb_bot_falange_angle_right, thumb_top_falange_angle_right, f1_bot_falange_angle_right, f1_top_falange_angle_right, f2_bot_falange_angle_right, f2_top_falange_angle_right, arm_angle1_left, arm_angle_2_left, forearm_angle_left, hand_angle_left, thumb_bot_falange_angle_left, thumb_top_falange_angle_left, f1_bot_falange_angle_left, f1_top_falange_angle_left, f2_bot_falange_angle_left, f2_top_falange_angle_left) object{ union { // create arm object { union { box { <-0.05, -0.05, 0>, <0.05, 0.05, 0.12> // near lower left corner, far upper right corner texture{ tx_clank_light_gray} } box { <-0.055, -0.04, 0.03>, <0.055, 0.04, 0.1> // near lower left corner, far upper right corner texture{ tx_clank_dark_gray} } } } // append arms object{ // hand union { object { clank_arm( forearm_angle_left,hand_angle_left, thumb_bot_falange_angle_left, thumb_top_falange_angle_left, f1_bot_falange_angle_left, f1_top_falange_angle_left, f2_bot_falange_angle_left, f2_top_falange_angle_left ) rotate <-90, arm_angle1_left, -arm_angle_2_left> // translate <0, -0.07, 0.08> // } object { clank_arm( forearm_angle_right,hand_angle_right, thumb_bot_falange_angle_right, thumb_top_falange_angle_right, f1_bot_falange_angle_right, f1_top_falange_angle_right, f2_bot_falange_angle_right, f2_top_falange_angle_right ) scale <1,-1,1> rotate <90, arm_angle1_right, arm_angle_2_right> // translate <0, 0.07, 0.08> // } } } // append head object { clank_chin(mouth_angle) rotate <0,0,head_angle> translate <0, 0, 0.13> // } // Propulsor cylinder { <0, 0, -0.02>, <0, 0, 0.010>, 0.04 // center of one end, center of other end, radius open // remove end caps texture{ tx_clank_dark_gray} } object { clank_propulsor() rotate <0,0,prop_rot> translate <0, 0, prop_trans> // } } } #end #include "eixos.inc" #macro interpola_vec(tt, t1, t2, vec1, vec2) #local i=0; #local vec_interpol = array[24]; #while (i < 24) #local vec_interpol[i] = interpola1(tt, t1,t2, vec1[i], vec2[i]); #local i = i+1; #end vec_interpol; #end #macro interpola1(tt, tt0,tt1, vv0,vv1) #local rr = (tt - tt0)/(tt1 - tt0); #local vv = (1-rr)*vv0 + rr*vv1; vv; #end #macro robo_line() #local ii = 0; #local xx = 0; #while (ii < 1) object { robo_mov(ii) translate } #local ii = ii + 0.025; #local xx = xx + 0.2; #end #end #macro quadro(tf) #local PP = array[24] #local P0 = array[24] #local P1 = array[24] #local P2 = array[24] #local P3 = array[24] #local P0[0] = 180; // prop_rot #local P0[1] = -0.02; // prop_trans, #local P0[2] = 40; // mouth_angle #local P0[3] = 60; // head_angle, #local P0[4] = -80; // arm_angle1_right #local P0[5] = 20; // arm_angle_2_right #local P0[6] = 45; // forearm_angle_right #local P0[7] = 30; // hand_angle_right, #local P0[8] = 45; // thumb_bot_falange_angle_right #local P0[9] = 20; // thumb_top_falange_angle_right, #local P0[10] = 90; // f1_bot_falange_angle_right #local P0[11] = 45; // f1_top_falange_angle_right, #local P0[12] = 50; // f2_bot_falange_angle_right #local P0[13] = 10; // f2_top_falange_angle_right #local P0[14] = 45; // arm_angle1_left #local P0[15] = -20; // arm_angle_2_left #local P0[16] = 45; // forearm_angle_left #local P0[17] = 30; // hand_angle_left, #local P0[18] = 45; // thumb_bot_falange_angle_left #local P0[19] = 20; // thumb_top_falange_angle_left, #local P0[20] = 90; // f1_bot_falange_angle_left #local P0[21] = 45; // f1_top_falange_angle_left, #local P0[22] = 80; // f2_bot_falange_angle_left #local P0[23] = 50; // f2_top_falange_angle_left #local P1[0] = 0; // prop_rot #local P1[1] = 0.02; // prop_trans, #local P1[2] = 0; // mouth_angle #local P1[3] = 0; // head_angle, #local P1[4] = 0; // arm_angle1_right #local P1[5] = 0; // arm_angle_2_right #local P1[6] = 0; // forearm_angle_right #local P1[7] = 0; // hand_angle_right, #local P1[8] = 0; // thumb_bot_falange_angle_right #local P1[9] = 0; // thumb_top_falange_angle_right, #local P1[10] = 0; // f1_bot_falange_angle_right #local P1[11] = 0; // f1_top_falange_angle_right, #local P1[12] = 0; // f2_bot_falange_angle_right #local P1[13] = 0; // f2_top_falange_angle_right #local P1[14] = 0; // arm_angle1_left #local P1[15] = 0; // arm_angle_2_left #local P1[16] = 0; // forearm_angle_left #local P1[17] = 0; // hand_angle_left, #local P1[18] = 0; // thumb_bot_falange_angle_left #local P1[19] = 0; // thumb_top_falange_angle_left, #local P1[20] = 0; // f1_bot_falange_angle_left #local P1[21] = 0; // f1_top_falange_angle_left, #local P1[22] = 0; // f2_bot_falange_angle_left #local P1[23] = 0; // f2_top_falange_angle_left #local P2[0] = -180; // prop_rot #local P2[1] = 0.02; // prop_trans, #local P2[2] = 40; // mouth_angle #local P2[3] = -60; // head_angle, #local P2[4] = 45; // arm_angle1_right #local P2[5] = -20; // arm_angle_2_right #local P2[6] = 45; // forearm_angle_right #local P2[7] = 30; // hand_angle_right, #local P2[8] = 45; // thumb_bot_falange_angle_right #local P2[9] = 20; // thumb_top_falange_angle_right, #local P2[10] = 90; // f1_bot_falange_angle_right #local P2[11] = 45; // f1_top_falange_angle_right, #local P2[12] = 80; // f2_bot_falange_angle_right #local P2[13] = 50; // f2_top_falange_angle_right #local P2[14] = -80; // arm_angle1_left #local P2[15] = 20; // arm_angle_2_left #local P2[16] = 45; // forearm_angle_left #local P2[17] = 30; // hand_angle_left, #local P2[18] = 45; // thumb_bot_falange_angle_left #local P2[19] = 20; // thumb_top_falange_angle_left, #local P2[20] = 90; // f1_bot_falange_angle_left #local P2[21] = 45; // f1_top_falange_angle_left, #local P2[22] = 50; // f2_bot_falange_angle_left #local P2[23] = 10; // f2_top_falange_angle_left #local P3[0] = 0; // prop_rot #local P3[1] = 0;; // prop_trans, #local P3[2] = 0; // mouth_angle #local P3[3] = 0; // head_angle, #local P3[4] = 0; // arm_angle1_right #local P3[5] = 0; // arm_angle_2_right #local P3[6] = 0; // forearm_angle_right #local P3[7] = 0; // hand_angle_right, #local P3[8] = 0; // thumb_bot_falange_angle_right #local P3[9] = 0; // thumb_top_falange_angle_right, #local P3[10] = 0; // f1_bot_falange_angle_right #local P3[11] = 0; // f1_top_falange_angle_right, #local P3[12] = 0; // f2_bot_falange_angle_right #local P3[13] = 0; // f2_top_falange_angle_right #local P3[14] = 0; // arm_angle1_left #local P3[15] = 0; // arm_angle_2_left #local P3[16] = 0; // forearm_angle_left #local P3[17] = 0; // hand_angle_left, #local P3[18] = 0; // thumb_bot_falange_angle_left #local P3[19] = 0; // thumb_top_falange_angle_left, #local P3[20] = 0; // f1_bot_falange_angle_left #local P3[21] = 0; // f1_top_falange_angle_left, #local P3[22] = 0; // f2_bot_falange_angle_left #local P3[23] = 0; // f2_top_falange_angle_left #local T0 = 0.00; #local T1 = 0.25; #local T2 = 0.50; #local T3 = 0.80; #local T4 = 1.00; #if ((T0 <= tf) & (tf <= T1)) #local PP = interpola_vec(tf, T0,T1, P0,P1) #elseif ((T1 <= tf) & (tf <= T2)) #local PP = interpola_vec(tf, T1,T2, P1,P2) #elseif ((T2 <= tf) & (tf <= T3)) #local PP = interpola_vec(tf, T2,T3, P2,P3) #elseif ((T3 <= tf) & (tf <= T4)) #local PP = interpola_vec(tf, T3,T4, P3,P0) #end object { robo_vec(PP) translate <0, 0, 0.15> } #end // Aqui est� a cena, finalmente: union{ object{ground} // object{ eixos(0.1) } // robo_line() object{ quadro(clock)} } #include "camlight.inc" #declare centro_cena = < 0, 0, 0.25 >; #declare raio_cena = 0.43; #declare dir_camera = < 1.00, 1.00, 0.30 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)