// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-09-26 19:36:04 by stolfilocal #declare semente = seed(42); #declare M = 500; #declare N = 500; #declare A = array[M*N]; #declare num_ponta_tanque = 0; 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.90, 0.82, 0.70 >, color rgb < 0.80, 0.90, 0.95 > } finish{ diffuse 0.9 ambient 0.1 } scale 10 } #declare raio = 2.000; #declare tanqueA = union { union { box { <-1, -1, 0>, <1, 1, 0.2> // near lower left corner, far upper right corner texture {tx_plastico} } cone { <0, 0, 0.2>, 0.25 // , center & radius of one end <0, 0, 1.3>, 1 // , center & radius of the other end texture {tx_plastico} } } } #declare tanqueB = union { union { cylinder { <0, 0, 0>, <0, 0, 1>, 1 // center of one end, center of other end, radius texture {tx_plastico} } box { <-0.6, -0.6, 1>, <0.6, 0.6, 1.6> // near lower left corner, far upper right corner texture {tx_plastico} } } } #declare tanqueC = union { union { box { <-1, -1, 0>, <1, 1, 2> // near lower left corner, far upper right corner texture {tx_plastico} } sphere { <0, 0, 2>, 1 // , radius texture {tx_plastico} } } } #declare chao = box{ <-200,-200,-1>, <+200,+200,0> } #include "eixos.inc" #macro gera_tanquesA(xx, yy) union { #local p1 = ; #local q1 = ; #local q2 = <2+xx, yy, 0.7>; #local q3 = ; #declare A[num_ponta_tanque] = q1; #declare num_ponta_tanque = num_ponta_tanque + 1; box { , // near lower left corner, far upper right corner texture {tx_plastico} } cone { , 0.25 // , center & radius of one end , 1 // , center & radius of the other end texture {tx_plastico} } cylinder { , q1, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } cylinder { , q2, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } cylinder { , q3, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } } #end #macro gera_tanquesB(xx, yy) union { #local p1 = ; #local q1 = ; #local q2 = <2+xx, yy, 0.7>; #local q3 = ; #declare A[num_ponta_tanque] = q1; #declare num_ponta_tanque = num_ponta_tanque + 1; cylinder { , , 1 // center of one end, center of other end, radius texture {tx_plastico} } box { , // near lower left corner, far upper right corner texture {tx_plastico} } cylinder { , , 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } cylinder { , <2+xx, yy, 0.7>, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } cylinder { , , 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } } #end #macro gera_tanquesC(xx, yy) union { #local p1 = ; #local q1 = ; #local q2 = <2+xx, yy, 0.7>; #local q3 = ; #declare A[num_ponta_tanque] = q1; #declare num_ponta_tanque = num_ponta_tanque + 1; box { , // near lower left corner, far upper right corner texture {tx_plastico} } sphere { , 1 // , radius texture {tx_plastico} } cylinder { , , 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } cylinder { , <2+xx, yy, 0.7>, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } cylinder { , , 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_fosca} } } #end #macro gera_tanques_grade(m, n) #local tipo_tanque = int(3*rand(semente)); #if(tipo_tanque = 0) object {gera_tanquesA(m, n)} #end #if(tipo_tanque = 1) object {gera_tanquesB(m, n)} #end #if(tipo_tanque = 2) object {gera_tanquesC(m, n)} #end #end #declare nx = 4; #declare ny = 5; union{ // object{ eixos(3.00) } #declare m_atual = 0; #while(m_atual < nx) #declare n_atual = 0; #while(n_atual < ny) object {gera_tanques_grade(10*m_atual, 10*n_atual)} #declare n_atual = n_atual + 1; #end #declare m_atual = m_atual + 1; #end object{ chao translate < 0,0,-0.01 > texture{ tx_xadrez } } } #declare min_cena = < 10*(0-0.5), 10*(0-0.5), 0 >; #declare max_cena = < 10*(nx-0.5), 10*(ny-0.5), 1 >; #include "camlight.inc" #declare centro_cena = 0.5*(min_cena + max_cena); #declare raio_cena = 0.6*vlength(min_cena - max_cena); #declare dir_camera = < 200.00, 200.00, 90.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)