// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2003-09-04 15:25:26 by stolfi // ====================================================================== // CÂMERA #include "textures.inc" #include "colors.inc" camera { location 8*<5, 10, 10 > // Posição do observador. right -1*x // Largura RELATIVA da imagem. up .75*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 0.00, 0 > // Para onde a câmera está apontando. } // Nota: os parâmetros "right" e "up" devem ter a mesma proporção // que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile. // ====================================================================== // FONTES DE LUZ light_source { 10 * < +50.0, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 * < +50.0, -10.0, +10.0 > // Posição da lâmpada. color rgb 0.8 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { < 0, -12.75, 2 > // Posição da lâmpada. color rgb < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { < 0, -12.75, 5.5 > // Posição da lâmpada. color rgb 0.4 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { < 0, -12.75, 4 > // Posição da lâmpada. color rgb 0.5 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.75, 0.80, 0.85 > } #declare raio = 2.000; #declare tinta1 = texture { pigment { color rgb < 0.10, 0.80, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta2 = texture { pigment { color rgb < 0.40, 0.10, 0.70 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta3 = texture { pigment { color rgb < 0, 0, 0 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta4 = texture { pigment { color rgb < 0.0, 0.0, 0.0 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta5 = texture { pigment { color rgb < 1, 1, 1 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta6 = texture { pigment { color rgb < 1, 1, 0 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta7 = texture { pigment { color rgb < 1, 1, 1 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare chamine = lathe {linear_spline 5, <0.5,0>, <0.5,1>, <1,2.5>, <1,2.8>, <0.5,4> texture {Chrome_Metal} } #declare locomotiva = union{ box{ <0,0,0>,<5,3,4> texture {tinta5} } difference{ cylinder{ <0,1.5,1>, <-4,1.5,1>, 1.8 texture {Chrome_Metal} } box{ <-5,-2,-1>, <5,5,0> texture{tinta1} } } } #declare roda = union{ cylinder{ <0,0,1>, <0,.3,1>, 1 texture {tinta3} } cylinder{ <0,.3,1>, <0,3.8,1>, .2 texture {tinta2} } cylinder{ <0,3.8,1>, <0,4.1,1>, 1 texture {tinta3} } } #declare fundo = plane {z,0 texture{Jade} scale 0.5 } #declare janela = box{<0,0,0>,<4,1.5,1.5> texture{tinta1} } #declare vagao = union{ difference{ box{<0,0,0>,<9,3,4.5> texture {Chrome_Metal} } union{ object{janela rotate z*90 translate <3,-.5,2.5>} object{janela rotate z*90 translate <5,-.5,2.5>} object{janela rotate z*90 translate <7,-.5,2.5>} } } cylinder{<9,1.5,1.5>, <10,1.5,1.5>, .5 texture {tinta1} } cylinder{<0,1.5,1.5>, <-1,1.5,1.5>, .5 texture {tinta1} } object{roda translate <1,-.4,0>} object{roda translate <3.5,-.4,0>} object{roda translate <6,-.4,0>} object{roda translate <8.5,-.4,0>} } #declare eixoX = cylinder {<-300,0,0>,<300,0,0>,.1 texture {tinta1} } #declare eixoY = cylinder {<0,-300,0>,<0,300,0>,.1 texture {tinta2} } #declare eixoZ = cylinder {<0,0,-300>,<0,0,300>,.1 texture {tinta3} } #declare eixos= union{ object{eixoX} object{eixoY} object{eixoZ} } #declare gerador = seed(10); #declare frente = union { //object{chamine translate <0,0,2>} object{locomotiva rotate z*-90 translate <0,0,2>} object {roda rotate z*-90 translate <-.4,3.5,1>} object {roda rotate z*-90 translate <-.4,-3,1>} object {chamine rotate x*90 translate <1.5,3,4> } // object{fundo} } //object{frente rotate z*90} #declare gerador = seed(10); #declare fim = union{ #declare i=0; object {frente translate <7,8,-1.5 > rotate z*30 } #declare a= rand(gerador)*5 +5; #while(i rotate z*-60 } #declare i=i+1; #end } #declare trilhocircular = union{ difference{ cylinder {<0,0,0>,<0,0,.1>,10 texture{tinta3}} cylinder {<0,0,-1>,<0,0,.2>,9.8 texture{tinta3}} } difference{ cylinder {<0,0,0>,<0,0,.1>,11 texture{tinta3}} cylinder {<0,0,-1>,<0,0,.2>,10.8 texture{tinta3}} } } #declare vagaocircular = object {vagao rotate z*90 translate <-50,-3,0>} #declare tremcircular = union{ object {frente translate <-52,0,0> rotate z*-2} object {vagaocircular rotate z*12} object {vagaocircular rotate z*24} object {vagaocircular rotate z*36} object {vagaocircular rotate z*48} object {vagaocircular rotate z*60} object {vagaocircular rotate z*72} object {vagaocircular rotate z*84} } //estacao #declare quarto1 = union{ box { < 0,0,0>, <2,2,.5> texture {Chrome_Metal} } box{ <-.01,0.3,.15>, <2.1,1.7,.35> texture {DMFWood3} } box{ <.3,-.01,.15><1.7,2.1,.35> texture {DMFWood3} } } #declare quarto2 = union{ box { < 0,0,0>, <2,2,.5> texture {Chrome_Metal} } box{ <-.01,0.3,0>, <2.01,.7,.35> texture {tinta3} } box{ <.3,-.01,0><.7,2.1,.35> texture {tinta3} } } #declare quarto3 = difference{ union{ box { < 0,0,0>, <2,2,.5> texture {Chrome_Metal} } box{ <-.01,0.3,.15>, <2.1,1,.35> texture {DMFWood3} } box{ <.3,-.01,.15><1,2.1,.35> texture {DMFWood3} } } union{ box{ <-.01,1,.15>, <2.1,1.7,.35> texture {tinta7} } box{ <1,-.01,.15><1.7,2.1,.35> texture {tinta7} } } } #declare fundo = plane {z,0 texture{Jade} scale 0.5 } #declare gerador = seed(10); declare estacao = union{ #declare a=0; #while(a<10) #declare j=0; #while(j<10) #declare i=0; #while(i<10) #if(a = 0) #if(rand(gerador)>.6) object{quarto2 translate <2*i,2*j,a*.5>} #else object{quarto1 translate <2*i,2*j,a*.5>} #end #else #if(rand(gerador)>.8) object{quarto3 translate <2*i,2*j,a*.5>} #else object{quarto1 translate <2*i,2*j,a*.5>} #end #end #declare i=i+1; #end #declare j=j+1; #end #declare a=a+1; #end #while(a<15) #declare j=3; #while(j<7) #declare i=3; #while(i<7) #if(a = 0) #if(rand(gerador)>.3) object{quarto2 translate <2*i,2*j,a*.5>} #else object{quarto1 translate <2*i,2*j,a*.5>} #end #else object{quarto1 translate <2*i,2*j,a*.5>} #end #declare i=i+1; #end #declare j=j+1; #end #declare a=a+1; #end } //fim estacao #declare tempo=clock; #declare h=0.2; #declare D=360; #declare A=D/(2*h*(1-h)); #declare B=-A*h*h; #declare C=2*A*h; #declare tempo = clock; #if(tempo <.2) #declare posicao= A*clock*clock; #else #if(tempo <.8) #declare posicao= B + C*clock; #else #declare posicao= D - A*(1-clock)*(1-clock); #end #end #declare gerador = seed(10); union{ object {tremcircular rotate z*-posicao} object {fundo} //object {eixos} object {trilhocircular scale<5,5,1>} object {estacao scale <2,2,2> translate <-20,-100,0>} }