// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2003-09-04 15:25:26 by stolfi // ====================================================================== // CÂMERA camera { location < 25.00, 25.00, 50.00 > // Posição do observador. right -1.00*x // Largura RELATIVA da imagem. up 0.5*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 0.00, 0.00 > // 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. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.75, 0.80, 0.85 > } #declare raio = 2.000; #declare tinta_A = texture { pigment { color rgb < 1, 0, 0 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_B = texture { pigment { color rgb < 0, 1, 0 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_C = texture { pigment { color rgb < 0, 0, 1 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare cor_cristal = pigment {color rgb <0.00, 0.00, 0.00>} #declare cor_espelho = pigment {color rgb <0.01, 0.01, 0.01>} #declare tx_cristal = texture{ finish{ ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment{color rgb <1.00, 0.50, 0.50> filter 1} } #declare tx_espelho = texture{ pigment{rgb <0.00, 0.80, 0.80>} finish{ ambient 0.05 diffuse 0.05 reflection rgb <0.80, 0.80, 0.80> specular 0.20 roughness 0.05 } } #declare eixos = // x é vermelho // y é verde // z é azul union { object { cylinder{ <-50.00, 0, 0> <50, 0, 0>, 0.2 } } object { cone { <50, 0, 0> , 0.5 <52, 0, 0> , 0 } } texture {tinta_A} } union{ object{ cylinder{ <0, -50, 0> <0,50,0>, 0.2 } } object{ cone { <0, 50, 0> , 0.5 <0, 52, 0> , 0 } } texture {tinta_B} } union{ object{ cylinder{ <0, 0, -50> <0, 0, 50>, 0.2 } } object{ cone { <0, 0, 50> , 0.5 <0, 0, 52> , 0 } } texture {tinta_C} } #declare locomotiva = box { < 5.00, 16.00, 2.00 >, < -5.00, 22.00, 8.00 > texture {tinta_B} } #declare roda = union{ #declare i = 0; #while (i < 3) object { cylinder{ <0, 17.8, 1> <0, 18.2, 1>, 1 } rotate z*10*i } object { cylinder{ <0, 19.8, 1> <0, 20.2, 1>, 1 } rotate z*10*i } #declare i = i +1; #end } #declare vagao = union{ object{roda} object{locomotiva rotate 10*z} } #declare dormente = box{ <-0.2, 18, -0.2>, <0.2, 20, 0.2> //texture {tinta_A} } #declare trilho = union{ object{ torus { 18, 0.2 // major and minor radius texture { tinta_B } rotate 90*x } } object{ torus { 20, 0.2 // major and minor radius texture { tinta_B } rotate 90*x } } #declare i = 0; #while (i < 20) object {dormente rotate z*30*i} #declare i = i +1; #end } #declare trem = union{ #declare i = 0; #while (i < 4) object {vagao rotate z*40*i} #declare i = i +1; #end } #declare trem_mov = union{ #if (clock < 0.2) #declare posicao = 360*clock*clock; object {trem rotate z*posicao} #else #if (clock <= 1) #declare posicao = -360*0.2*0.2 + 2*360*0.2*clock; object {trem rotate z*posicao} #else #declare posicao = 360 - 360*(1-clock)*(1-clock); //object {trem rotate z*posicao} #end #end } // Aqui está a cena, finalmente: union{ //object {eixos} object {trilho} object {trem_mov} }