// CORES E TEXTURAS background{ color rgb < 1.00, 1.00, 1.00 > } #declare tx_forma = texture{ pigment{ color rgb < 0.00, 0.85, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_cano = texture{ pigment{ color rgb < 1.00, 0.50, 0.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 1.00, 0.00, 0.00 >, color rgb < 0.00, 0.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare grau1 = union{ sphere{ < 0,0,0 >, 0.25 texture{ tx_forma }} cylinder{ < 0, 0, 0 >, < 0, 0.4, 0 >, 0.1 texture{ tx_cano } } } #declare grau2 = union{ box{ <-0.25,-0.25,-0.25>, <0.25,0.25,0.25> texture{ tx_forma }} sphere{ < 0,0,0.5 >, 0.25 texture{ tx_forma }} cylinder{ < 0, 0, 0.125 >, < 0, 0.4, 0.125 >, 0.1 texture{ tx_cano } } cylinder{ < 0, 0, 0.125 >, < 0, -0.4, 0.125 >, 0.1 texture{ tx_cano } } } #declare grau3 = union{ cylinder{ < 0, 0, -0.25 >, < 0, 0, 0.25 >, 0.25 texture{ tx_forma } } sphere{ < 0,0,0.5 >, 0.25 texture{ tx_forma }} cylinder{ < 0, 0.0, 0.125 >, < 0, 0.4, 0.125 >, 0.10 texture{ tx_cano } } cylinder{ < 0, 0, 0.125 >, < 0, -0.4, 0.125 >, 0.1 texture{ tx_cano } } cylinder{ < 0, 0, 0.5 >, < 0, 0, 0.9 >, 0.1 texture{ tx_cano } } } #declare grau4 = union{ cone { <0, 0, -0.25>, 0.25 // , center & radius of one end <0, 0, 0.25>, 0.0 // , center & radius of the other end texture{ tx_forma } } sphere{ < 0,0,0.5 >, 0.25 texture{ tx_forma }} cylinder{ < 0, 0, 0.5 >, < 0, 0.4, 0.5 >, 0.1 texture{ tx_cano } } cylinder{ < 0, 0, 0.5 >, < 0, -0.4, 0.5 >, 0.1 texture{ tx_cano } } cylinder{ < 0, 0.0, 0 >, < 0, 0.4, 0 >, 0.10 texture{ tx_cano } } cylinder{ < 0, 0, 0 >, < 0, -0.4, 0 >, 0.1 texture{ tx_cano } } } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro interpola1(t_num, t0, v0, t1, v1) #local ss = (t_num - t0)/(t1 - t0); #local vv = ((1 - ss)*v0) + (ss*v1); vv #end #macro interpola3(t_num, ta, tb, v0, v1, v2, v3) #local v01 = interpola1(t_num, ta, v0, tb, v1); #local v12 = interpola1(t_num, ta, v1, tb, v2); #local v23 = interpola1(t_num, ta, v2, tb, v3); #local v012 = interpola1(t_num, ta, v01, tb, v12); #local v123 = interpola1(t_num, ta, v12, tb, v23); #local v0123 = interpola1(t_num, ta, v012, tb, v123); v0123 #end #macro testa_interpola_3(ta, tb, v0, v1, v2, v3) #local index = ta; union{ #while (index < tb) #local centro = interpola3(index, ta, tb, v0, v1, v2, v3); sphere{ centro, 0.25 texture{ tx_forma }} #local index = index + 1; #end } #end #include "eixos.inc" union{ object{ eixos(3.00) } object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } } object{testa_interpola_3(0, 8, <0, 0, 0>, <4, 4, 0>, <-6, -6, 0>, <8, 8, 0>)} #include "camlight.inc" #declare centro_cena = < 1.00, 1.00, 1.00 >; #declare raio_cena = 5.0; #declare dir_camera = < 6.00, 1.00, 5.00 >; #declare dist_camera = raio_cena; #declare intens_luz = 2.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)