// 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 < 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_verde = texture{ pigment{ color rgb < 0, 1, 0 > } finish{ diffuse 0.9 ambient 0.1 } } #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" #declare R = 0.3; #declare bolinha = sphere { <0,0,0>, R } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro interpola4(t0,v0,v1,v2,v3,t1,tt) //v0 v1 #local v01 = interpola(t0, v0, t1, v1, tt); //v1 v2 #local v12 = interpola(t0, v1, t1, v2, tt); //v2 v3 #local v23 = interpola(t0, v2, t1, v3, tt); //v01 v12 #local v012 = interpola(t0, v01, t1, v12, tt); //v12 v23 #local v123 = interpola(t0, v12, t1, v23, tt); //v012 v123 #local vv = interpola(t0, v012, t1, v123, tt); vv #end //interpola da aula 05 #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 inc = (x3-x0)/N; #local i = 0; #while(i translate yy } #local i = i + 1; #end } #end union{ object{ grafico(1, <1,1,1>,<-1,-1,-1>,<3,3,3>,<5/2,5/2,5/2>, 3,200) texture{ tx_verde } } object{ grafico(3, <5/2,5/2,5/2>,<2,2,2>,<3,3,3>,<15/2,15/2,15/2>, 5,200) texture{ tx_plastico } } object{ grafico(5, <15/2,15/2,15/2>,<12,12,12>,<5,5,5>,<6/2,6/2,6/2>, 7,200) texture{ tx_verde } } object{ grafico(7, <6/2,6/2,6/2>,<1,1,1>,<0,0,0>,<-1,-1,-1>, 9,200) texture{ tx_plastico } } scale 0.5 } object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 15.0; #declare dir_camera = < 0.00, 1.00, 1.00 >; #declare dist_camera = 15.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)