// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #include "textures.inc" #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.75, 0.75, 0.5 > filter 0.90 } finish{ diffuse 0 reflection 0.4 ambient 0.02 specular 0.25 roughness 0.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.80, 0.1, 0.10 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA #macro interpolaTudo(t0,v0,v1,v2,v3,t1,tt) #local v01 = interpola(t0,v0,t1,v1,tt); #local v12 = interpola(t0,v1,t1,v2,tt); #local v23 = interpola(t0,v2,t1,v3,tt); #local v012 = interpola(t0,v01,t1,v12,tt); #local v123 = interpola(t0,v12,t1,v23,tt); #local v0123 = interpola(t0,v012,t1,v123,tt); (v0123) #end #macro interpola(f0,v0,f1,v1,f) #local ss = (f-f0)/(f1-f0); #local rr = 1 - ss; (rr * v0 + ss * v1) #end #macro grafico(x0,y0,y1,y2,y3,x3, N) union { #local xx = x0; #local distancia = (x3-x0)/N; #local i = 0; #while(i translate yy } #end } #end #declare bola = sphere{ < 0,0,0 >, 0.1 } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ eixos(3.00) } object{ grafico (0,<0,0,0>,<-1,-2,-3>,<3,4,5>,<2,2,2>,3,35) texture {tx_xadrez} } object{ grafico (3,<2,2,2>,<3,3,3>,<4,4,4>,<5,5,5>,6,35) texture {tx_fosca} } object{ grafico (6,<5,5,5>,<-4,-4,-4>,<-3,-3,-3>,<-2,-2,-2>,9,35)texture {tx_xadrez} } object{ grafico (9,<-2,-2,-2>,<1,-1,1>,<-2,2,-2>,<4,-4,4>,12,35) texture {tx_fosca} } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 35.0; #declare dir_camera = < 5.00, 0.00, 1.00 >; #declare dist_camera = 25.0; #declare intens_luz = 1.25; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)