background{ color rgb < 0.8, 0.8, 0.9 > } // ====================================================================== // CORES E TEXTURAS #declare tx_plastico_marrom_claro = texture { pigment { color rgb < 0.5, 0.4, 0.3 > } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_marrom_escuro = texture { pigment { color rgb < 0.4, 0.3, 0.2 > } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== // PARTES #macro mao(b5) union { sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } cylinder { <0, 0, 0>, <3, 0, 0>, 1 rotate <0, b5, 0> texture { tx_plastico_marrom_claro } } cylinder { <0, 0, 0>, <3, 0, 0>, 1 rotate <0, b5, 60> texture { tx_plastico_marrom_claro } } cylinder { <0, 0, 0>, <3, 0, 0>, 1 rotate <0, b5, -60> texture { tx_plastico_marrom_claro } } } #end #macro cotovelo(b4, b5) union { object{ mao(b5) translate <5, 0, 0> rotate <0, b4, 0> } cylinder { <0, 0, 0>, <5, 0, 0>, 1 rotate <0, b4, 0> texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro membro(b1, b2, b3, b4, b5) union { object{ cotovelo(b4, b5) translate<5, 0, 0> rotate } cylinder { <0, 0, 0>, <5, 0, 0>, 1 rotate texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro cabeca(a5, a6) union { difference { box { <-0.75, -0.75, 0.5>, <0.75, 0.75, 2> texture { tx_plastico_marrom_claro } } cylinder { <0, 0.76, 1.25>, <0, 0.5, 1.25>, 0.5 texture { tx_plastico_marrom_claro } } } cylinder { <0, 0, 0.5>, <0, 0, 0>, 3 texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } rotate } #end #macro vertebra(a4, a5, a6) union { object{ cabeca(a5, a6) translate<0, 0, 5> rotate } cylinder { <0, 0, 0>, <0, 0, 5>, 1 rotate texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro pescoco(a1, a2, a3, a4, a5, a6) union { object{ vertebra(a4, a5, a6) translate<0, 0, 5> rotate } cylinder { <0, 0, 0>, <0, 0, 5>, 1 rotate texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro robo(a1, a2, a3, a4, a5, a6, b11, b12, b13, b14, b15, b21, b22, b23, b24, b25, b31, b32, b33, b34, b35, b41, b42, b43, b44, b45) union { box { <-2.5, -2.5, -5>, <2.5, 2.5, 5> texture {tx_plastico_marrom_claro} } object { pescoco(a1, a2, a3, a4, a5, a6) translate<0, 0, 5> } object { membro(b11, b12, b13, b14, b15) translate<2.5, 0, 4> } object { membro(b21, b22, b23, b24, b25) translate<2.5, 0, 4> scale <-1, 1, 1> } object { membro(b31, b32, b33, b34, b35) translate<2.5, 0, -4> } object { membro(b41, b42, b43, b44, b45) translate<2.5, 0, -4> scale <-1, 1, 1>} } #end #declare NP = 26; #macro empacota(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) #local P = array[NP]; #local P[0] = A0; #local P[1] = A1; #local P[2] = A2; #local P[3] = A3; #local P[4] = A4; #local P[5] = A5; #local P[6] = A6; #local P[7] = A7; #local P[8] = A8; #local P[9] = A9; #local P[10] = A10; #local P[11] = A11; #local P[12] = A12; #local P[13] = A13; #local P[14] = A14; #local P[15] = A15; #local P[16] = A16; #local P[17] = A17; #local P[18] = A18; #local P[19] = A19; #local P[20] = A20; #local P[21] = A21; #local P[22] = A22; #local P[23] = A23; #local P[24] = A24; #local P[25] = A25; P #end #macro acha_quadro(tt, NQ, TQ) #local k = 0; #for (i, 0, NQ-1) #if (TQ[i] <= tt & TQ[i + 1] >= tt) #local k = i; #end #end k #end #macro interpola_quadros(tt, ta, Pa, tb, Pb, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) #local s = (tt - ta)/(tb - ta); #declare A0 = (1-s) * Pa[0] + s * Pb[0]; #declare A1 = (1-s) * Pa[1] + s * Pb[1]; #declare A2 = (1-s) * Pa[2] + s * Pb[2]; #declare A3 = (1-s) * Pa[3] + s * Pb[3]; #declare A4 = (1-s) * Pa[4] + s * Pb[4]; #declare A5 = (1-s) * Pa[5] + s * Pb[5]; #declare A6 = (1-s) * Pa[6] + s * Pb[6]; #declare A7 = (1-s) * Pa[7] + s * Pb[7]; #declare A8 = (1-s) * Pa[8] + s * Pb[8]; #declare A9 = (1-s) * Pa[9] + s * Pb[9]; #declare A10 = (1-s) * Pa[10] + s * Pb[10]; #declare A11 = (1-s) * Pa[11] + s * Pb[11]; #declare A12 = (1-s) * Pa[12] + s * Pb[12]; #declare A13 = (1-s) * Pa[13] + s * Pb[13]; #declare A14 = (1-s) * Pa[14] + s * Pb[14]; #declare A15 = (1-s) * Pa[15] + s * Pb[15]; #declare A16 = (1-s) * Pa[16] + s * Pb[16]; #declare A17 = (1-s) * Pa[17] + s * Pb[17]; #declare A18 = (1-s) * Pa[18] + s * Pb[18]; #declare A19 = (1-s) * Pa[19] + s * Pb[19]; #declare A20 = (1-s) * Pa[20] + s * Pb[20]; #declare A21 = (1-s) * Pa[21] + s * Pb[21]; #declare A22 = (1-s) * Pa[22] + s * Pb[22]; #declare A23 = (1-s) * Pa[23] + s * Pb[23]; #declare A24 = (1-s) * Pa[24] + s * Pb[24]; #declare A25 = (1-s) * Pa[25] + s * Pb[25]; #end #macro cena(tt) #local NQ = 6; #local TQ = array[NQ + 1]; #local PQ = array[NQ + 1]; #local TQ[0] = 0.00; #local PQ[0] = empacota(0, 0, 0, 0, 0, 0, 90, -30, 60, 60, 45, 90, 30, 60, 60, 45, 90, -30, 60, 60, 45, 90, 30, 60, 60, 45) #local TQ[1] = 0.167; #local PQ[1] = empacota(0, 0, 0, 0, 0, 0, 90, -30, 60, 60, 45, 90, 30, 30, 30, 45, 90, -30, 60, 60, 45, 90, 30, 30, 30, 45) #local TQ[2] = 0.333; #local PQ[2] = empacota(0, 0, 0, 0, 0, 0, 90, 30, 60, 60, 45, 90, -30, 30, 30, 45, 90, 30, 60, 60, 45, 90, -30, 30, 30, 45) #local TQ[3] = 0.500; #local PQ[3] = empacota(0, 0, 0, 0, 0, 0, 90, 30, 60, 60, 45, 90, -30, 60, 60, 45, 90, 30, 60, 60, 45, 90, -30, 60, 60, 45) #local TQ[4] = 0.667; #local PQ[4] = empacota(0, 0, 0, 0, 0, 0, 90, 30, 30, 30, 45, 90, -30, 60, 60, 45, 90, 30, 30, 30, 45, 90, -30, 60, 60, 45) #local TQ[5] = 0.833; #local PQ[5] = empacota(0, 0, 0, 0, 0, 0, 90, -30, 30, 30, 45, 90, 30, 60, 60, 45, 90, -30, 30, 30, 45, 90, 30, 60, 60, 45) #local TQ[6] = 1.00; #local PQ[6] = empacota(0, 0, 0, 0, 0, 0, 90, -30, 60, 60, 45, 90, 30, 60, 60, 45, 90, -30, 60, 60, 45, 90, 30, 60, 60, 45) #local k = acha_quadro(tt, NQ, TQ); // Zera as variaveis dos angulos para satisfazer POV-Ray: #local A0 = 0; #local A1 = 0; #local A2 = 0; #local A3 = 0; #local A4 = 0; #local A5 = 0; #local A6 = 0; #local A7 = 0; #local A8 = 0; #local A9 = 0; #local A10 = 0; #local A11 = 0; #local A12 = 0; #local A13 = 0; #local A14 = 0; #local A15 = 0; #local A16 = 0; #local A17 = 0; #local A18 = 0; #local A19 = 0; #local A20 = 0; #local A21 = 0; #local A22 = 0; #local A23 = 0; #local A24 = 0; #local A25 = 0; interpola_quadros(tt, TQ[k], PQ[k], TQ[k+1], PQ[k+1], A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25 ); #local rob = object { robo(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) } rob #end // ====================================================================== union { cylinder { <10, -10, -10>, <-20, 20, 20>, 1 texture {tx_plastico_marrom_escuro} } object { cena(clock) rotate <55, 0, -135> translate <0, 0, -8> } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, -5.00 >; #declare raio_cena = 30.0; #declare dir_camera = < 1, 1, 0 >; #declare dist_camera = 5 * raio_cena; #declare intens_luz = 1.2; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)