// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-09-26 17:52:17 by stolfilocal 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, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #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 < 1, 0, 0 >, color rgb < 0, 0, 0 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare tx_table_row = texture { pigment { // Define the background color color rgb <0.8, 0.8, 0.8> } finish { // Adjust the reflectivity and other surface properties ambient 0.3 diffuse 0.7 specular 0.2 reflection 0.3 } } #declare tx_table_row_border = texture { pigment { // Use a wood-like pattern for the border wood turbulence 0.5 color_map { [0.0 color rgb <0.4, 0.2, 0>] // Dark wood color [0.5 color rgb <0.4, 0.2, 0>] // Dark wood color [1.0 color rgb <0.8, 0.4, 0>] // Light wood color } } finish { ambient 0.2 diffuse 0.8 } } // Define a wood-like texture #declare tx_place = texture { pigment { checker color rgb <0.2, 0.2, 0.2>, color rgb <0.8, 0.8, 0.8> scale 0.5 // Adjust the scale of the checkers pattern } finish { ambient 0.2 diffuse 0.8 } } // Define a chess piece texture (white marble) #declare tx_tanque = texture { pigment { marble color_map { [0.0 color rgb <1, 1, 1>] // White color [0.7 color rgb <0.8, 0.8, 0.8>] // Light gray color } scale 0.5 // Adjust the scale of the marble pattern } finish { ambient 0.2 diffuse 0.8 specular 0.9 } } #declare tx_cano = texture { pigment { color rgb < 0.9, 0.6, 0.0 > } finish { ambient 0.2 diffuse 0.8 specular 0.9 } } #declare raioSust = 0.25; #declare raioPoste = 0.5; #declare raioPerna = 0.5; #declare CyT1 = cylinder { <0, 0, 0>, <0, 0, 2>, 0.5 // center of one end, center of other end, radius } #declare CoT1 = cone { <0, 0, 2>, 0.5 // , center & radius of one end <0, 0, 3>, 0.1 // , center & radius of the other end } #declare CoT2 = cone { <0, 0, 0>, 0.75 // , center & radius of one end <0, 0, 2>, 0.25 // , center & radius of the other end } #declare EsT2 = sphere { <0, 0, 2>, 0.3 // , radius } #declare BoT3 = box { <-0.25, -0.25, 0>, <0.25, 0.25, 1.5> // near lower left corner, far upper right corner } #declare CyT3 = cylinder { <0, 0, 1.5>, <0, 0, 3>, 0.5 // center of one end, center of other end, radius } #declare ponta1 = cylinder { <0, 0, 0>, <0, 1, 0>, 0.1 } #macro ponta(inicio, fim) union{ object { cylinder { inicio, fim, 0.1 // center of one end, center of other end, radius } texture { tx_cano } } } #end #macro tanque1(position) union { object{ CyT1 translate position texture { tx_tanque } } object{ CoT1 translate position texture { tx_tanque } } object{ ponta(<0,0,3>, <0,0,3.5>) translate position } object{ ponta(<-0.4,0,1>, <-1,0,1>) translate position } object{ ponta(<0,0.4,1>, <0,1,1>) translate position } } #end #macro tanque2(position) union { object{ CoT2 translate position texture { tx_tanque } } object{ EsT2 translate position texture { tx_tanque } } object{ ponta(<0.4,0,1>, <1,0,1>) translate position } object{ ponta(<-0.4,0,1>, <-1,0,1>) translate position } object{ ponta(<0,0.4,1>, <0,1,1>) translate position } } #end #macro tanque3(position) union { object{ BoT3 translate position texture { tx_tanque } } object{ CyT3 translate position texture { tx_tanque } } object{ ponta(<0,0,3>, <0,0,3.5>) translate position } object{ ponta(<.25,0,0.75>, <0.75,0,0.75>) translate position } object{ ponta(<0,0.25,0.75>, <0,0.75,0.75>) translate position } } #end #macro tubulacao(p, q) union{ #declare roleta2 = seed( 90 ); #declare altura = 9 * rand(roleta1) + 4; object{ cylinder{ p, , 0.1 } texture { tx_cano } } object{ cylinder{ q, , 0.1 } texture { tx_cano } } object{ cylinder{ , , 0.1 } texture { tx_cano } } } #end #macro faz_ligacao() union{ #local roleta3 = seed( 200 ); #local i = int( total_tocos * rand(roleta3) ); #local j = int( (total_tocos - 1) * rand(roleta3) ); #if (j = i) #local j = j + 1; #end #local p = A[i]; #local q = A[j]; object{ tubulacao(p, q) } #declare A[i] = A[total_tocos - 1]; #declare A[j] = A[total_tocos - 2]; #declare total_tocos = total_tocos - 2; } #end #macro gera_tanques(m, n) union{ #declare total_tocos = m * n * 3; #declare A = array[ total_tocos ]; #declare ta = 0; #declare m0 = 1; #declare baseEspace = 4; #declare m02 = int(m / 2); #declare n02 = int(n / 2); #declare roleta1 = seed( 100 ); #while (m0 <= m) #declare n0 = 1; #while (n0 <= n) #declare x_n0 = (m0 - m02) * baseEspace; #declare y_n0 = (n0 - n02) * baseEspace; #declare s = int(rand(roleta1) * 3); #if (mod(s, 3) = 0) object { tanque1() } #declare A[ta] = ; #declare A[ta + 1] = ; #declare A[ta + 2] = ; #else #if (mod(s, 3) = 1) object { tanque2() } #declare A[ta] = ; #declare A[ta + 1] = ; #declare A[ta + 2] = ; #else #if (mod(s, 3) = 2) object { tanque3() } #declare A[ta] = ; #declare A[ta + 1] = ; #declare A[ta + 2] = ; #end #end #end #declare ta = ta + 3; #declare n0 = n0 + 1; #end #declare m0 = m0 + 1; #end #declare ta = 0; #declare nr_A = total_tocos; #while (total_tocos > 1) object{ faz_ligacao() } #end } #end #include "eixos.inc" #declare nx = 7; #declare ny = 5; union{ object{ gera_tanques(nx, ny) } } #declare min_cena = < 2*(-nx+1.5), 2*(-ny+1.5), 0 >; #declare max_cena = < 2*(+nx+1.5), 2*(+ny+1.1), 14 >; #include "camlight.inc" #declare centro_cena = 0.5*(min_cena + max_cena); #declare raio_cena = 0.5*vlength(min_cena - max_cena); #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 100*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)