// 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.00, 0.50 > } 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 #include "bezpoly.inc" #macro interpola3_multi(tt, pini, n, p1, p2, pfim) #local k = tt; #local raio = 0.10; union{ object{ bezpoly_multi(n, pini, p1, p2, pfim, 0.9*raio) } #while (k < n) #local centro = interpola3(tt, k, k+1, pini, p1[k], p2[k], pfim); sphere{ centro, 2*raio texture{ tx_cano }} #local k = k + 1; #end } #end union{ object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object{ grau1 translate < 0,2,2 > texture{ tx_xadrez } } object{ grau2 translate < 2,2,2 > texture{ tx_xadrez } } object{ grau3 translate < 2,0,2 > texture{ tx_xadrez } } object{ grau4 translate < 0,0,2 > texture{ tx_xadrez } } } #local pini = <0, 0, 0>; #local n = 3; #local p1 = array[n] #local p1[0] = <1, 0, 0>; #local p1[1] = <2, 0, 0>; #local p1[2] = <3, 0, 0>; #local p2 = array[n] #local p2[0] = <1, 1, 0>; #local p2[1] = <2, 2, 0>; #local p2[2] = <3, 3, 0>; #local pfim = <3, 3, 0>; object{interpola3_multi(0, pini, n, p1, p2, pfim)} #include "eixos.inc" // object{ eixos(5) } #declare cmin = < -17, -4, -0.5 >; #declare cmax = < +5, +11, +2.0 >; box{ cmin-0.1*z, texture{ pigment{ color rgb <0.80,0.70,0.60> } finish {diffuse 0.7 ambient 0.3 } } } #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmin - cmax); #declare dir_camera = < 3.00, 1.00, 2.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)