// Daniel Camillo Collier Farias RA:059878 // PARAMETROS DE ANIMACAO #macro interpola(t0,v0,t1,v1,tt) #local ss = (tt-t0)/(t1-t0); #local rr = 1-ss; (rr*v0 + ss*v1) #end #macro interpola4(t0,v0,v1,v2,v3,t3,tt) #local v01 = interpola(t0,v0,t3,v1,tt); #local v12 = interpola(t0,v1,t3,v2,tt); #local v23 = interpola(t0,v2,t3,v3,tt); #local v012 = interpola(t0,v01,t3,v12,tt); #local v123 = interpola(t0,v12,t3,v23,tt); interpola(t0,v012,t3,v123,tt); #end #macro grafico(x0, y0, y1, y2, y3, x3, N) union { #local i = 1; #local xx = x0; #while(i<=N) #local xx = xx + ((x3-x0)/N); #local yy = interpola4(x0, y0, y1, y2, y3, x3, xx); object{ sphere { <0,xx,yy>, 0.05} } #local i = i+1; #end } #end // ====================================================================== // 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_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 } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui está a cena, finalmente: #macro curva() grafico(0,2,4,-4,4,5,200) grafico(5,4,12,0,1,10,200) grafico(10,1,2,3,0,15,100) grafico(15,0,-3,0,15,20,500) #end union { curva() object { eixos(20.00) texture{ tx_plastico } } } #include "camlight.inc" #declare centro_cena = < 0.00, 15, 10 >; #declare raio_cena = 20.0; #declare dir_camera = < 1, 0, 0>; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)