// 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_cor00 = texture{ pigment{ color rgb < 0.30, 1.00, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 1.0 roughness 0.005 } } #declare tx_cor01 = texture{ pigment{ color rgb < 1.00, 0.20, 0.20 > } finish{ diffuse 0.6 ambient 0.1 specular 1.0 roughness 0.005 } } #declare tx_cor02 = texture{ pigment{ color rgb < 0.30, 0.30, 1.00 > } finish{ diffuse 0.5 ambient 0.1 specular 1.0 roughness 0.005 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare rad = 0.2; // Partes do mosquito: #declare mosquito_base = union { cylinder{ //corpo < 0, 0, 0 >, < +0.00, +3.00 , +0.00 >, 0.70 texture{tx_cor00} } sphere{ //cabeça < +0.00, +3.00 , +0.00 >, 0.80 texture{tx_cor00} } sphere{ //olho 1 < +0.3, +3.40, +0.00 >, 0.50 texture{tx_cor01} } sphere{ //olho 2 < -0.3, +3.40, +0.00 >, 0.50 texture{tx_cor01} } sphere{ //bunda < 0.00, +0.00, +0.00 >, 0.70 texture{tx_cor00} } cylinder{ //boca < +0.00, +3.80 , -0.20 >, < +0.00, +4.30 , -0.40 >, 0.10 texture{tx_cor00} } } #declare mosquito_parte_perna = union { sphere{ //aticulacao < 0.00, +0.00, +0.00 >, 0.15 texture{tx_cor00} } cylinder{ //parte perna < +0.00, +0.00 , +0.00 >, < +0.00, +0.80 , +0.00 >, 0.15 texture{tx_cor00} } } #macro valor_graus () #local gr = array[6][5]; #local gr[0][0] = <30, 70, -90>; #local gr[0][1] = <20, 0, -95>; #local gr[0][2] = <0, 0, 90>; #local gr[0][3] = <0, 0, -90>; #local gr[0][4] = <0, 0, 90>; #local gr[1][0] = <20, 70, -85>; #local gr[1][1] = <20, 0, -95>; #local gr[1][2] = <0, 30, 40>; #local gr[1][3] = <0, -20, -20>; #local gr[1][4] = <0, 0, -45>; #local gr[2][0] = <-20, 70, -90>; #local gr[2][1] = <0, 0, -95>; #local gr[2][2] = <0, 0, -45>; #local gr[2][3] = <0, 0, -45>; #local gr[2][4] = <20, 0, -45>; #local gr[3][0] = <30, 50, -90>; #local gr[3][1] = <0, 0, -95>; #local gr[3][2] = <0, 0, -45>; #local gr[3][3] = <0, 20, -45>; #local gr[3][4] = <0, 20, -45>; #local gr[4][0] = <30, 70, -80>; #local gr[4][1] = <0, 0, -95>; #local gr[4][2] = <0, 0, -45>; #local gr[4][3] = <0, 0, -45>; #local gr[4][4] = <20, 0, -45>; #local gr[5][0] = <-20, 70, -90>; #local gr[5][1] = <0, 0, -95>; #local gr[5][2] = <0, 20, -0>; #local gr[5][3] = <0, 0, -0>; #local gr[5][4] = <0, 20, -0>; gr #end #macro mosquito (graus, t_parte, t_perna) union { object{perna_1 (graus, 0, t_parte) translate t_perna} object{perna_1 (graus, 1, t_parte) translate t_perna+<0,1,0>} object{perna_1 (graus, 2, t_parte) translate t_perna+<0,2,0>} object{perna_1 (graus, 3, t_parte) translate t_perna scale<-1, 1, 1>} object{perna_1 (graus, 4, t_parte) translate t_perna+<0,1,0> scale<-1, 1, 1>} object{perna_1 (graus, 5, t_parte) translate t_perna+<0,2,0> scale<-1, 1, 1>} object{mosquito_base} } #end #macro perna_1 (graus, i, tt) union { #local new_graus = array[4]; #local new_graus[0] = graus[i][1]; #local new_graus[1] = graus[i][2]; #local new_graus[2] = graus[i][3]; #local new_graus[3] = graus[i][4]; object{perna_2 (new_graus, tt) translate tt} object{mosquito_parte_perna} rotate graus[i][0] } #end #macro perna_2 (graus, tt) union { #local new_graus = array[3]; #local new_graus[0] = graus[1]; #local new_graus[1] = graus[2]; #local new_graus[2] = graus[3]; object{perna_3 (new_graus, tt) translate tt} object{mosquito_parte_perna} rotate graus[0] } #end #macro perna_3 (graus, tt) union { #local new_graus = array[2]; #local new_graus[0] = graus[1]; #local new_graus[1] = graus[2]; object{perna_4 (new_graus, tt) translate tt} object{mosquito_parte_perna} rotate graus[0] } #end #macro perna_4 (graus, tt) union { object{perna_5 (graus[1]) translate tt} object{mosquito_parte_perna} rotate graus[0] } #end #macro perna_5 (alfa) object{mosquito_parte_perna rotate alfa } #end #include "eixos.inc" // Aqui está a cena, finalmente: object{ eixos(3.00) } #declare modelo = valor_graus (); object{mosquito (modelo, < +0.00, +0.80 , +0.00 >, <0.7, 0.0, 0.0>) } #include "camlight.inc" #declare centro_cena = < 10.00, 10, 10.00 >; #declare raio_cena = 3.0; #declare dir_camera = < 10.00, 10.00, 10.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)