// Last edited on 2019-07-17 12:22:45 by stolfilocal // Processed by remove-cam-lights 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 RAIO = 1; #declare articulacao = sphere { <0,0,0>, RAIO texture {tx_plastico}}; #declare segmento = cylinder { <0,0,0>, <0,0,-4>, RAIO texture {tx_plastico}}; #macro makePerna() #union{ object {articulacao} object {segmento translate <0,0,-1>} } #end #macro makePerna2(angulo) #union{ object { makePerna() } object { makePerna() rotate translate <0, 0, -6> } } #end #macro makePerna3(angulo2,angulo1) #union{ object { makePerna() } object { makePerna2(angulo1) rotate translate <0, 0, -6> } } #end #macro makePerna4(angulo3,angulo2,angulo1) #union{ object { makePerna() } object { makePerna3(angulo2,angulo1) rotate translate <0, 0, -6> } } #end #macro makePerna5(angulo4,angulo3,angulo2,angulo1) #union{ object { makePerna() } object { makePerna4(angulo3,angulo2,angulo1) rotate translate <0, 0, -6> } } #end #macro makePerna6(angulo5,angulo4,angulo3,angulo2,angulo1) #union{ object { makePerna() } object { makePerna5(angulo4,angulo3,angulo2,angulo1) rotate translate <0, 0, -6> } } #end #macro makePernaFull(position, angulo6,angulo5,angulo4,angulo3,angulo2,angulo1) #union{ object { makePerna6(angulo5,angulo4,angulo3,angulo2,angulo1) rotate translate position } } #end #macro makePernaStand(position) #union{ object { makePernaFull(position,45,-90,90,-90,90,-90) } } #end #macro makePernaCurl(position) #union{ object { makePernaFull(position,45,20,15,30,-45,45) } } #end #macro makeBixoCorpo() #union{ object { box { <-5,-10,-2>, <5,10,3> texture {tx_plastico} } } } #end #macro interpolin(t0, v0, t1, v1, tt) #local r = (tt- t0)/(t1-t0); #local s = 1-r; #local vv = s*v0+r*v1; vv #end #macro interpolMatriz(t0,m0,t1,m1,tt) #local i=0; #local mt = array[6][6] #while(i<6) #local j=0; #while(j<6) #declare mt[i][j] = interpolin(t0,m0[i][j],t1,m1[i][j],tt); #local j = j+1; #end #local i = i+1; #end mt #end #macro dragao(position, grid_angulos) #union{ object { makeBixoCorpo() } object { makePernaFull(<-5,-10,-2>, grid_angulos[0][0], grid_angulos[0][1], grid_angulos[0][2], grid_angulos[0][3], grid_angulos[0][4], grid_angulos[0][5]) } object { makePernaFull(<5,-10,-2>, grid_angulos[1][0], grid_angulos[1][1], grid_angulos[1][2], grid_angulos[1][3], grid_angulos[1][4], grid_angulos[1][5]) } object { makePernaFull(<-5,0,-2>, grid_angulos[2][0], grid_angulos[2][1], grid_angulos[2][2], grid_angulos[2][3], grid_angulos[2][4], grid_angulos[2][5]) } object { makePernaFull(<5,0,-2>, grid_angulos[3][0], grid_angulos[3][1], grid_angulos[3][2], grid_angulos[3][3], grid_angulos[3][4], grid_angulos[3][5]) } object { makePernaFull(<-5,10,-2>, grid_angulos[4][0], grid_angulos[4][1], grid_angulos[4][2], grid_angulos[4][3], grid_angulos[4][4], grid_angulos[4][5]) } object { makePernaFull(<5,10,-2>, grid_angulos[5][0], grid_angulos[5][1], grid_angulos[5][2], grid_angulos[5][3], grid_angulos[5][4], grid_angulos[5][5]) } translate position } #end #declare teste = array[3][6][6] { { {90,0,0,0,0,0}, {90,0,0,0,0,0}, {90,0,0,0,0,0}, {90,0,0,0,0,0}, {90,0,0,0,0,0}, {90,0,0,0,0,0} }, { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {-90,0,0,0,0,0}, {-90,0,0,0,0,0}, {-90,0,0,0,0,0}, {-90,0,0,0,0,0}, {-90,0,0,0,0,0}, {-90,0,0,0,0,0} } } #declare teste0 = array[6][6] { {60,0,0,0,0,0}, {60,0,0,0,0,0}, {60,0,0,0,0,0}, {60,0,0,0,0,0}, {60,0,0,0,0,0}, {60,0,0,0,0,0} } #declare teste1 = array[6][6] { {-60,0,0,0,0,0}, {-60,0,0,0,0,0}, {-60,0,60,0,0,0}, {-60,0,0,0,0,0}, {-60,0,0,0,60,0}, {-60,30,0,0,0,0} } #macro cena(clk) #union{ #local m = interpolMatriz(0, teste0, 1, teste1, clk) object{ dragao(<0,-40,10>, m) } } #end cena(clock) #include "camlight.inc" #declare centro_cena = < 0.00, -30.00, 0.00 >; #declare raio_cena = 60; #declare dir_camera = < 1.00, 1.00, 0.20 >; #declare dist_camera = 10*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)