// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-12-08 11:01:46 by jstolfi #version 3.6; // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare brown_soft_149_111_82 = color rgb < 149/255, 111/255, 82/255 >; #declare brown_darker_86_47_31 = color rgb < 86/255, 47/255, 31/255 >; #declare tx_woodfloor = texture{ pigment{ brown_soft_149_111_82 } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_assento_blocked = texture{ pigment{ color rgb < 255/255, 0/255, 0/255 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_assento_free = texture{ pigment{ color rgb < 0/255, 255/255, 0/255 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare chair_height = 5; #declare chair_width = 3; #macro assento(is_free) // blocked: is_free != 1 // free: is_free == 1 #if (is_free = 1) #local which_tx = tx_assento_free; #else #local which_tx = tx_assento_blocked; #end union{ //back box{<0, 0, chair_height*0.33 - chair_height*0.066>, texture{ which_tx } } //assento box{<0, 0, chair_height*0.33>, texture{ which_tx } } //left side fill box{<0, 0, 0>, texture{ which_tx } } //right side fill box{, texture{ which_tx } } } #end #macro auditorio(m, n) // m: rows // n: seats #local at_row = 0; #local at_seat = 0; #local is_free = 1; union{ #while(at_row < m) #local is_free = 1; #local at_seat = 0; #while(at_seat < n) object{ assento(is_free) translate } #if (is_free = 1) #local is_free = 0; #else #local is_free = 1; #end #local at_seat = at_seat + 1; #end #local at_row = at_row + 1; #end } #end #declare chao = box{ <-60,-60,-1>, <+60,+60,0> } #include "eixos.inc" // Aqui está a cena, finalmente: #declare rows = 20; #declare seats = 12; union{ //object{ eixos(4.00) translate <-6, 0, 0>} object{ chao translate < 0,0,-5 > texture{ tx_woodfloor } } object{ auditorio(rows,seats) translate <-10,-20,-5> } } #declare tam = < seats*2*chair_width, rows*2*chair_height, 0>; #include "camlight.inc" #declare centro_cena = tam/2 + 3*chair_width*z + <-10,-20,-5>; #declare raio_cena = 0.50*vlength(tam); #declare dir_camera = < -3.00, 7.00, 2.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)