// 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 > } #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 < 0.3, 0.3, 1.00 > } 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 } #include "eixos.inc" //Programa #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro interpola(f0,v0,f1,v1,f) #local ss = (f-f0)/(f1-f0); #local rr = 1-ss; (rr*v0+ss*v1) #end #macro interpola_complicado (t0, v0, v1, v2, v3, t3, tt) //Fase 1 #local v01 = interpola(t0,v0,t3,v1,tt); #local v12 = interpola(t0,v1,t3,v2,tt); #local v23 = interpola(t0,v2,t3,v3,tt); //Fase 2 #local v012 = interpola(t0,v01,t3,v12,tt); #local v123 = interpola(t0,v12,t3,v23,tt); //Fase 3 interpola(t0,v012,t3,v123,tt); #end #macro grafico(x0, y0, y1, y2, y3, x3, N) #local intervaloX = (x3-x0)/N; #local X=x0; #while(X<=x3) #local Y = interpola_complicado(x0, y0, y1, y2, y3, x3, X); #local X = X + intervaloX; object{sphere {<0,X,Y> 0.1} texture{tx_espelho}} #end #end #macro grafico4(x0, y_inicial, y10, y11, y20, y21, y30, y31, y40, y41, y_final, x3, N) #local y_inicial1 = (y11+y20)/2; #local y_inicial2 = (y21+y30)/2; #local y_inicial3 = (y31+y40)/2; grafico(x0,y_inicial,y10,y11,y_inicial1,x3/4,N) grafico(x3/4,y_inicial1,y20,y21,y_inicial2,x3/2,N) grafico(x3/2,y_inicial2,y30,y31,y_inicial3,3*x3/4,N) grafico(3*x3/4,y_inicial3,y40,y41,y_final,x3,N) #end grafico4(-4, 0, -2, 2, 4, 6, -1, 3, -4, 1, 2, 10, 30) //object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object{ eixos(3.00) } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 17.0; #declare dir_camera = < 1.00, 0.00, 0.00 >; #declare dist_camera = 6.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)