// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-09-30 19:57:13 by jstolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.5, 0.5, 0.5 > } #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.00, 0.00 > } 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 raio = 2.000; #declare origem = <0,0,0>; #declare centro = <10,20,30>*2; // Partes da cena: /*#declare bolinhaPerna1 = sphere{ origem, 0.2 } #declare bolinhaPerna2 = sphere{<2,0,0>, 0.2 } #declare bolinhaPerna3 = sphere{<0,2,0>, 0.2 } #declare bolinhaPerna4 = sphere{<2,2,0>, 0.2 } #declare perna1 = cylinder {<0, 0, 0.05>, <0, 0, 4>, 0.2 } #declare perna2 = cylinder {<2, 0, 0.05>, <2, 0, 2>, 0.2 } #declare perna3 = cylinder {<0, 2, 0.05>, <0, 2, 4>, 0.2 } #declare perna4 = cylinder {<2, 2, 0.05>, <2, 2, 2>, 0.2 } #declare assento = box{<-0.2, -0.2, 1.8>, <2.2,2.2,2.2>} #declare canto1 = cone {<0,0,6>, 0.3 <0,0,0>, 0 } #declare canto3 = cone {<0,2,6>, 0.3 <0,2,0>, 0 } #declare encosto = box {<-0.2,0,3>, <0.2,2,4>} #declare buraco = cone {<0,1,3.5>, 0 <1,1,3.5>, 3 } #declare bola = sphere{ origem, raio texture{ tx_plastico } } #declare pino = cylinder{ < 2.00, -2.00, -1.00 >, < -2.00, 2.00, +1.00 >, 0.5 texture{ tx_fosca } } #declare furo = cylinder{ < -1.00, -2.00, -2.00 >, < +1.00, +2.00, +2.00 >, 0.75*raio texture{ tx_fosca } } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> }*/ #declare peao = union{ cone{ <0,0,0>,0.1 <0,0,0.2>,0 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 0.00 > } translate <0,0,0.4>} box{<-0.1,-0.1,0>, <0.1,0.1,0.2> texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 0.00 > } translate <0,0,0.2>} sphere{<0,0,0>, 0.2 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 0.00 > }} } #declare dama = union { sphere{<0,0,0>, 0.1 texture {tx_plastico} translate <0,0,0.4>} cone{ <0,0,0>,0.1 <0,0,0.2>,0 texture {tx_plastico} translate <0,0,0.2> } box{<-0.1,-0.1,0>, <0.1,0.1,0.2> texture {tx_plastico}} } #declare tabuleiro = difference { cylinder {<0,0,0>, <0,0,0.0001>, 2 texture {tx_vidro}} cylinder {<0,0,1>, <0,0,-1>, 1 texture {tx_plastico}} } #macro cria ( m,n ) #declare i = 1; #while (i <= m) object {tabuleiro translate <0,0,-i/10> scale } #declare j = 1; #while (j <= n) #if (mod(i,2) = 0 & mod(j,2) = 0) object{dama translate } #end #if (mod(i,2) = 1 & mod(j,2) = 1) object{peao translate } #end #declare j = j+1; #end #declare i = i+1; #end #end #include "eixos.inc" cria(4,4) //object {peao} // Aqui est� a cena, finalmente: /* pe union{ object{ eixos(3.00) } union { object{ bolinhaPerna1 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > }} difference { object{perna1 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} object{canto1 texture {tx_plastico}} } } union { object{ bolinhaPerna2 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > }} object{perna2 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} } union { object{ bolinhaPerna3 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > } } difference { object{perna3 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} object{canto3 texture {tx_plastico}} } } union { object{ bolinhaPerna4 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > } } object{perna4 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} } object {assento texture {tx_fosca } pigment{ color rgb < 0.20, 0.20, 0.20 > }} difference { object {encosto texture {tx_vidro}} object {buraco texture {tx_plastico}} } object{ bolota translate < -2,+1,+3 > texture{ tx_espelho } } object{ bolinha translate < +5,+4,+2 > texture{ tx_vidro } interior { ior 1.01 } }*/ #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)