// ====================================================================== // CORES E TEXTURAS #include "textures.inc" #include "eixos.inc" #include "transforms.inc" #include "shapes.inc" background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.35 ambient 0.02 specular 0.25 roughness 0.005 ior 1.1} } // ====================================================================== // DESCRIÇÃO DA CENA //Definição recursiva // #macro interpola(tt, t1, t2, v1, v2) // ((t2-tt)*v1 + (tt-t1)*v2) / (t2-t1) // #end // // #macro interpola4(tt, t1, t2, v1, v2, v3, v4) // #local v12 = interpola(tt, t1, t2, v1, v2); // #local v23 = interpola(tt, t1, t2, v2, v3); // #local v34 = interpola(tt, t1, t2, v3, v4); // // #local v123 = interpola(tt, t1, t2, v12, v23); // #local v234 = interpola(tt, t1, t2, v23, v34); // // #local v1234 = interpola(tt, t1, t2, v123, v234); // v1234 // #end //Definição Algébrica #macro interpola4(tt, t1, t2, v1, v2, v3, v4) #local q=(tt-t1)/(t2-t1); 1*(1-q)*(1-q)*(1-q)*v1 + 3*(1-q)*(1-q)*( q)*v2 + 3*(1-q)*( q)*( q)*v3 + 1*( q)*( q)*( q)*v4 #end #macro curvaBezier(v1, v2, v3, v4, N, Raio_Bola, Raio_Cilindro, Raio_Bola_Quadro, Raio_Cilindro_Quadro, Mat_Bola, Mat_Cilindro, Mat_Bola_Quadro, Mat_Cilindro_Quadro, ) #local i=0; #while (i<=N) #local P=interpola4(i, 0, N, v1,v2,v3,v4); sphere { P, Raio_Bola texture {Mat_Bola} } #if (i > 0) cylinder { Prev_P, P, Raio_Cilindro texture {Mat_Cilindro} } #end #local Prev_P = P; #local i=i+1; #end sphere { v1, Raio_Bola_Quadro texture { Mat_Bola_Quadro } } // sphere { // v2, Raio_Bola_Quadro // texture { Mat_Bola_Quadro } // } // sphere { // v3, Raio_Bola_Quadro // texture { Mat_Bola_Quadro } // } sphere { v4, Raio_Bola_Quadro texture { Mat_Bola_Quadro } } // cylinder { // v1, v2, Raio_Cilindro_Quadro // texture { Mat_Cilindro_Quadro } // } // cylinder { // v2, v3, Raio_Cilindro_Quadro // texture { Mat_Cilindro_Quadro } // } // cylinder { // v3, v4, Raio_Cilindro_Quadro // texture { Mat_Cilindro_Quadro } // } #end #macro curvaBezierX(v1, v2, v3, v4) curvaBezier(v1,v2,v3,v4, 20, 1, 0.8, 1.5, 0.2, Sapphire_Agate, tx_vidro, Jade, Sapphire_Agate) #end #declare random_seed = seed (56); #macro random() rand(random_seed) #end #macro vrandom() vnormalize(< 1-2*random(), 1-2*random(), 1-2*random() >) #end #declare _P1=30*vrandom(); #declare _P2=30*vrandom(); #declare P1=30*vrandom(); #declare P4=30*vrandom(); #declare P2=P1+vlength(P4-P1)*vrandom(); #declare P3=P4+vlength(P4-P1)*vrandom(); #declare _P1=P1; #declare _P2=P2; #declare NSEGS=9; #declare i=0; #while (i; #declare raio_cena = 70; #declare dir_camera = <0,1,0>; #declare dist_camera = 100; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)