// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2017-05-07 20:10:09 by stolfilocal // ====================================================================== // 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 } } // ====================================================================== // DESCRIÇÃO DA CENA #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 makeBixoCurl(position) #union{ object { makeBixoCorpo() } object { makePernaStand(<-5,-10,-2>) } object { makePernaStand(<5,-10,-2>) } object { makePernaStand(<-5,0,-2>) } object { makePernaStand(<5,0,-2>) } object { makePernaCurl(<-5,10,-2>) } object { makePernaCurl(<5,10,-2>) } translate position } #end #macro makeBixoStand(position) #union{ object { makeBixoCorpo() } object { makePernaStand(<-5,-10,-2>) } object { makePernaStand(<5,-10,-2>) } object { makePernaStand(<-5,0,-2>) } object { makePernaStand(<5,0,-2>) } object { makePernaStand(<-5,10,-2>) } object { makePernaStand(<5,10,-2>) } translate position } #end #macro makeBixoGenerico(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 // Aqui está a cena, finalmente: #declare teste = array[6][6] { {7,-6,-7,20,-2,1}, {1,2,-3,-24,5,38}, {0,9,8,7,16,1}, {1,-32,3,4,5,16}, {0,9,-8,-7,-6,5}, {1,1,2,-32,3,-10} } object { makeBixoGenerico(<0,-40,10>, teste) } object { makeBixoCurl(<0,10,10>) } #include "camlight.inc" #declare centro_cena = < 0.00, 0.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)