// CORES E TEXTURAS #include "colors.inc" #include "textures.inc" #include "eixos.inc" background{ color Quartz } #declare tx_vidro = texture{ pigment{ color Quartz filter 0.8 } finish{ diffuse 0.2 ambient 0.05 reflection 0.25 } } #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_plastico2 = texture{ pigment{ color Scarlet } finish{ diffuse 0.8 ambient 0.1 specular 0.5 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 } // Macro para calculo de valores intermediarios #macro interpola_step(t0, v0, t1, v1, tt) #local ss = (tt-t0)/(t1-t0); #local rr = 1-ss; (rr*v0 + ss*v1) #end // Macro #macro interpola_besie(t0, v0, v1, v2, v3, t3, tt) #local v01 = interpola_step(t0,v0,t3,v1,tt); #local v12 = interpola_step(t0,v1,t3,v2,tt); #local v23 = interpola_step(t0,v2,t3,v3,tt); #local v012 = interpola_step(t0,v01,t3,v12,tt); #local v123 = interpola_step(t0,v12,t3,v23,tt); interpola_step(t0,v012,t3,v123,tt); #end // Macro grafico #macro Grafico(x0, y0, y1, y2, y3, x3, N) #local nn = 0; #local dx = (x3 - x0)/N; #local xx = x0; #local yy = 0; union{ #while(nn < N) #local yy = interpola_besie(x0,y0,y1,y2,y3,x3,xx); #if (nn = N-1) sphere{ 0.16 pigment { Blue } } #else sphere{ 0.15 pigment { Red } } #end #local xx = xx + dx; #local nn = nn + 1; #end } #end #macro Grafico4(x00, y00, y01, y02, y03, x03, y10, y11, y12, y13, x13, y20, y21, y22, y23, x23, y30, y31, y32, y33, x33, N) #local d01 = (y02 + y11)/2; #local d12 = (y12 + y21)/2; #local d23 = (y22 + y31)/2; Grafico(x00, y00, y01, y02, d01, x03, N) Grafico(x03, d01, y11, y12, d12, x03+x13, N) Grafico(x03+x13, d12, y21, y22, d23, x03+x13+x23, N) Grafico(x03+x13+x23,d23, y31, y32, y33, x03+x13+x23+x33, N) #end union{ Grafico4(0,5,1,9,5,6,4,2,6,4,6,1,0,2,1,6,5,1,9,5,6,50) translate <-12,-4,0> } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 20.0; #declare dir_camera = <0.00, 0.01, 15.00 >; #declare dist_camera = 20.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)