// Daniel Camillo Collier Farias RA:059878 // PARAMETROS DE ANIMACAO //cotoveloe #declare NQ = 9 ; #declare angA = array[NQ]; #declare angA[0]= -90; #declare angA[1] = -90; #declare angA[2] = -90; #declare angA[3] = -90; #declare angA[4] = 0; #declare angA[5] = -90; #declare angA[6] = -90; #declare angA[7] = -90; #declare angA[8] = -90; //cotovelod #declare angB = array[NQ]; #declare angB[0] = -90; #declare angB[1] = -90; #declare angB[2] = -90; #declare angB[3] = 0; #declare angB[4] = -90; #declare angB[5] = -90; #declare angB[6] = -90; #declare angB[7] = 0; #declare angB[8] = -90; //ombrod_x #declare angC = array[NQ]; #declare angC[0] = 0; #declare angC[1] = -60; #declare angC[2] = 0; #declare angC[3] = 0; #declare angC[4] = 0; #declare angC[5] = 0; #declare angC[6] = -60; #declare angC[7] = 0; #declare angC[8] = 0; //ombroe_x #declare angD = array[NQ]; #declare angD[0] = 0; #declare angD[1] = -60; #declare angD[2] = 0; #declare angD[3] = 0; #declare angD[4] = 0; #declare angD[5] = 0; #declare angD[6] = -60; #declare angD[7] = 0; #declare angD[8] = 0; //virilhae_y #declare angE = array[NQ]; #declare angE[0] = 0; #declare angE[1] = 0; #declare angE[2] = 0; #declare angE[3] = 0; #declare angE[4] = 0; #declare angE[5] = -90; #declare angE[6] = -90; #declare angE[7] = -90; #declare angE[8] = 0; //virilhad_y #declare angF = array[NQ]; #declare angF[0] = 0; #declare angF[1] = -90; #declare angF[2] = -90; #declare angF[3] = -90; #declare angF[4] = 0; #declare angF[5] = 0; #declare angF[6] = 0; #declare angF[7] = 0; #declare angF[8] = 0; //joelho_e #declare angG = array[NQ]; #declare angG[0] = 0; #declare angG[1] = 0; #declare angG[2] = 0; #declare angG[3] = 0; #declare angG[4] = 0; #declare angG[5] = 90; #declare angG[6] = 0; #declare angG[7] = 90; #declare angG[8] = 0; //joelho_d #declare angH = array[NQ]; #declare angH[0] = 0; #declare angH[1] = 90; #declare angH[2] = 0; #declare angH[3] = 90; #declare angH[4] = 0; #declare angH[5] = 0; #declare angH[6] = 0; #declare angH[7] = 0; #declare angH[8] = 0; #declare fq=array[NQ]; #declare fq[0] = 0.0; #declare fq[1] = 0.12; #declare fq[2] = 0.24; #declare fq[3] = 0.36; #declare fq[4] = 0.48; #declare fq[5] = 0.60; #declare fq[6] = 0.72; #declare fq[7] = 0.84; #declare fq[8] = 1.0; #macro interpola(f0,v0,f1,v1,f) #local ss = (f-f0)/(f1-f0); #local rr = 1-ss; (rr*v0 + ss*v1) #end #macro quadroanterior(fase) #local i = 0; #while (i < NQ-1) #if ((fq[i] <=fase) & (fq[i+1] >= fase)) #local resp = i; #end #local i = i+1; #end resp #end // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #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_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #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 } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #macro cabeca(z_rot) union { sphere{ <0.0,0.0,0.0>, 0.7 } cone{ <0.0, 0.0, 0.4>, 0.2, <0.0, 0.0, 2>, 0 rotate -10*x translate 0.15*y} cone{ <0.0, 0.0, 0.4>, 0.2, <0.0, 0.0, 2>, 0 rotate 10*x translate -0.15*y } rotate z_rot*z } #end #macro art_cotovelo(z_rot) union{ sphere{ <0.0,0.0,0.0> 0.3} cone{ <0.0,0.0,0.0>, 0.2, <0.0,1,0.0>, 0.15 } sphere{ <0.0,1,0.0>, 0.4 } rotate z_rot*z } #end #macro art_ombro(z_rot, x_rot, cotovelo_rot) union { sphere{ <0.0,0.0,0.0> 0.3} cylinder{ <0.0,0.0,0.0>, <0.0,1,0.0>, 0.2 } union { art_cotovelo(cotovelo_rot) translate 1*y } rotate } #end #macro pe(y_rot) cylinder{ <0,0,0>, <0,0,1>, 0.5 } union{ box{ <1.6,-0.5,0.4>, <0, 0.5, 0>} rotate y_rot*y } #end #macro art_joelho(y_rot, pe_rot) union { sphere {<0,0,0>, 0.5} cone {<0,0,0>,0.4, <0,0,-1.5> 0.2} union { pe(pe_rot) translate -2.5*z } rotate y_rot*y } #end #macro art_virilha(y_rot, x_rot, joelho_rot, pe_rot) union { sphere {<0,0,0>, 0.8} cone {<0,0,0>,0.7, <0,0,-2> 0.4} union { art_joelho(joelho_rot,pe_rot) translate -2.3*z } scale 0.8 rotate } #end #macro corpo(head_rot, ombrod_z_rot,ombrod_x_rot,cotovelod_rot, ombroe_z_rot,ombroe_x_rot,cotoveloe_rot, virilhad_y_rot, virilhad_x_rot, joelhod_rot, ped_rot, virilhae_y_rot, virilhae_x_rot, joelhoe_rot, pee_rot) sphere{< 0.00, 0.00, 0.00 >, 1 } cone{<0.00,0.00,0.0> 1 , <0.00,0.00,2.2> 0.4} union { cabeca(head_rot) translate 2.7*z } union { art_ombro(ombrod_z_rot,ombrod_x_rot,cotovelod_rot) translate <0,0.7,1.5> } union { art_ombro(ombroe_z_rot,ombroe_x_rot,cotoveloe_rot) translate <0,0.7,1.5> scale -1*y } union { art_virilha(virilhad_y_rot, virilhad_x_rot, joelhod_rot, ped_rot) translate <0,-0.6, -0.5> } union { art_virilha(virilhae_y_rot, virilhae_x_rot, joelhoe_rot, pee_rot) translate <0,-0.6, -0.5> scale -1*y } #end #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ chao translate < 0,0,-5 > texture{ tx_xadrez }} //corpo(head_rot, ombrod_z_rot,ombrod_x_rot,cotovelod_rot, ombroe_z_rot,ombroe_x_rot,cotoveloe_rot, virilhad_y_rot, virilhad_x_rot, joelhod_rot, ped_rot, virilhae_y_rot, virilhae_x_rot, joelhoe_rot, pee_rot) //union { //corpo(0,0,0,-90,0,0,-90,0,0,0,0,0,0,0,0) //translate -4*y //} union { corpo(0,0,-60,-90,0,-60,-90,-90,0,90,0,0,0,0,0) } texture{ tx_plastico } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 12.0; #declare dir_camera = < 2, 0, 0 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)