// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2017-05-07 20:10:09 by stolfilocal // ====================================================================== // CORES E TEXTURAS #include "eixos.inc" background{ color rgb < 1, 1, 1> } #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.6, 0.70 > } 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.90, 0.62, 0.50 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRI\C7\C3O DA CENA #declare raio = 0.1; #declare raio_tube = 0.1; #declare num_steps = 100; #declare step_size = 1/num_steps; object { eixos(3) } // Partes da cena: #macro FazCirculo (R, N) #declare tt = 0; #declare step_size = 1/N; #while(tt <= N) #declare theta = 2 * pi * tt; object { sphere {, R} texture { tx_espelho } } /* uses a hypotrochoid */ #declare tt = tt + step_size; #end #end // Partes da cena: #macro FazQuadrado (R, N) #declare tt = 0; #declare step_size = 1/N; #while(tt <= N) #declare lado = N/4; #if ((tt>=0) & (tt, R} texture { tx_espelho } } #end #if ((tt>=lado) & (tt<2*lado)) object { sphere {, R} texture { tx_espelho } } #end #if ((tt>=2*lado) & (tt<3*lado)) object { sphere {<(tt-2*lado) , lado, 0>, R} texture { tx_espelho } } #end #if ((tt>=3*lado) & (tt<4*lado)) object { sphere {<0 , tt-3*lado, 0>, R} texture { tx_espelho } } #end #declare tt = tt + step_size; #end #end // Partes da cena: #macro FazQuadrado (R, N) #declare tt = 0; #declare step_size = 1/N; #while(tt <= N) #declare lado = N/8; #if ((tt>=0) & (tt, R} texture { tx_espelho } } #end #if ((tt>=0) & (tt, R} texture { tx_espelho } } #end #if ((tt>=lado) & (tt<2*lado)) #declare theta = 2*pi*(tt-lado); #if (theta <= pi) object { sphere {, R} texture { tx_espelho } } #end #end /* #if (theta <= pi/2) object { sphere {, R} texture { tx_espelho } } #end #end #if ((tt>=2*lado) & (tt<3*lado)) object { sphere {<(tt-2*lado) , lado, 0>, R} texture { tx_espelho } } #end #if ((tt>=3*lado) & (tt<4*lado)) object { sphere {<0 , tt-3*lado, 0>, R} texture { tx_espelho } } #end #if ((tt>=0) & (tt, R} texture { tx_espelho } } #end #if ((tt>=lado) & (tt<5*lado)) object { sphere {, R} texture { tx_espelho } } #end #if ((tt>=2*lado) & (tt<6*lado)) object { sphere {<(tt-2*lado) , lado, 0>, R} texture { tx_espelho } } #end #if ((tt>=3*lado) & (tt<7*lado)) object { sphere {<0 , tt-3*lado, 0>, R} texture { tx_espelho } } #end */ #declare tt = tt + step_size; #end #end // Partes da cena: #macro FazNo (num_steps, step_size) #declare N = -1; #while(N <= num_steps + 1) #declare theta = 2 * pi * N * step_size; object { sphere {<0.3*( 2*sin(2*theta)-sin(theta) ), 0.3*( 2*cos(2*theta)+cos(theta) ), 0.3*sin(3*theta)>, raio} texture { tx_espelho } } /* uses a hypotrochoid */ #declare N = N + 1; #end #end #include "eixos.inc" // Aqui est\E1 a cena, finalmente: //FazCirculo(0.1, 40) FazQuadrado(0.2, 20) // FazNo(num_steps, step_size) #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 5.0; #declare dir_camera = < 100.00, 100.00, 100.00 >; #declare dist_camera = 10*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)