// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // 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 #declare def_radius = 0.2; #declare def_sup_l = 2; #declare def_rot_l = 3; #declare def_peg_l = 2; #declare def_in_r = 0.35; #declare def_out_r = 0.5; //e1 = eixo de suporte //e2 = eixo de rot //e3 = eixo do pegador // Funcoes #macro pegador(raio, l_e1, l_e2,l_e3,siz,rz) #declare h_s = 1.99+l_e1; #declare j_r = 1.4*raio; #declare pin_h = h_s-j_r/2-l_e3; union { //base box { <0,-2,0> , <2,0,2> translate<0,0,0> rotate<0,0,rz> translate<0,0,0> } //eixo de suporte cylinder { <1+raio/2,-1+raio/2,1.99> , <1+raio/2,-1+raio/2,h_s> , raio translate <0,0,-1.99> rotate<0,0,rz> translate <0,0,1.99> } //juncao 01 sphere { <1+(raio)/2,-1+(raio)/2,h_s+0.01+j_r/2>, j_r translate <0,0,-(h_s+0.01+j_r/2)> rotate<0,0,rz> translate <0,0,(h_s+0.01+j_r/2)> } //eixo de rotacao cylinder { <1+raio/2,-1+raio/2,h_s+0.01+j_r/2> , <1+raio/2,l_e2,h_s+0.01+j_r/2> , raio translate <0,0,-(h_s+0.01+j_r/2)> rotate<0,0,rz> translate <0,0,(h_s+0.01+j_r/2)> } //juncao 02 sphere { <1+raio/2,l_e2+raio/2,h_s+0.01+j_r/2>, j_r translate <0,0,-(h_s+0.01+j_r/2)> rotate<0,0,rz> translate <0,0,(h_s+0.01+j_r/2)> } //eixo pegador cylinder { <1+raio/2,l_e2+raio/2,h_s-0.01+j_r/2>, <1+raio/2,l_e2+raio/2,h_s-j_r/2-l_e3>, raio translate <0,0,-(h_s-0.01+j_r/2)> rotate<0,0,rz> translate <0,0,(h_s-0.01+j_r/2)> } //pinca union { difference { difference { cylinder { <1+raio/2,l_e2+raio/2, pin_h+0.01-raio>, <1+raio/2,l_e2+raio/2, pin_h+0.01-raio-0.5>, def_out_r } cylinder { <1+raio/2,l_e2+raio/2, pin_h+0.01-raio+3>, <1+raio/2,l_e2+raio/2, pin_h+0.01-raio-3>, def_in_r } } box { <1+raio+0.01,l_e2-siz/2, pin_h-0.01-raio-0.5>, <1+raio+siz,l_e2+siz/2, pin_h+0.01+raio+0.5+siz> } } translate <-(1+raio/2),-(l_e2+raio/2), -(pin_h+0.01-raio)> rotate<0,90,0> translate <1+raio/2,l_e2+raio/2, pin_h+0.01-raio> translate <0.3,0,-0.3> translate <0,0, -(pin_h+0.01-raio-0.3)> rotate<0,0,rz> translate <0,0, (pin_h+0.01-raio-0.3)> } } #end // Partes da cena: #include "eixos.inc" // Aqui está a cena, finalmente: union { //esq object{ pegador(def_radius,def_sup_l+2,def_rot_l,def_peg_l,0.5,-30) rotate <0,30,-2> texture { tx_fosca } translate <0,-6,0> } //meio object{ pegador(def_radius,def_sup_l,def_rot_l,def_peg_l,1,45) rotate <0,30,-2> texture { tx_fosca } translate <0,3,0> } //dir object{ pegador(def_radius,def_sup_l+5,def_rot_l,def_peg_l,0.38,0) rotate <0,30,-2> texture { tx_fosca } translate <0,12,0> } } // Includes aqui em baixo! #include "camlight.inc" #declare centro_cena = < 0.00, 3.00, 1 >; #declare raio_cena = 22; #declare dir_camera = < 16.00, -2.8, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)