//Dependencias #include "colors.inc" //Iluminação light_source { <15, 15, -15> color rgb <1, 1, 1> } light_source { <10, 10, -10> color rgb <1, 1, 1> } // Observador camera { location <10,17,10> right -0.75*x // Largura RELATIVA da imagem. up 1*y // Altura RELATIVA da imagem. sky y // Qual direção é "para cima"? look_at <0, -2, 0> } //Fundo background{ color rgb <1, 1, 1> } //Cores #declare cor_metalico = <0.4, 0.31, 0.25>; #declare cor_cristal = <0.98, 0.98, 0.98, 0.9>; #declare amarelo = texture { pigment { color rgb < 1.00, 0.80, 0.10 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } //Texturas #declare tx_metalico = texture { pigment { rgb cor_metalico } finish { ambient 0.05 diffuse 0.05 reflection cor_metalico specular 0.20 roughness 0.05 } } #declare tx_cristal = texture { finish { ambient 0 diffuse 0 reflection 0.5 refraction 0.85 ior 1.5 phong 0.3 phong_size 60 specular 1 roughness 0.001 } pigment { color rgbf cor_cristal filter 1} } /*********************Auxiliar******************/ #declare eixos = union { // x axis cylinder { <-50, 0, 0>, <50, 0, 0>, 0.1 pigment { color rgb <1, 0, 0> } } // y axis cylinder { <0, -50, 0>, <0, 50, 0>, 0.1 pigment { color rgb <0, 1, 0> } } //z axis cylinder { <0, 0, -50>, <0, 0, 50>, 0.1 pigment { color rgb <0, 0, 1> } } } /***************************************/ //----SetorCilindro macro #macro SetorCilindro ( R_maior, R_menor, Altura, Angulo) #local D = 0.0001; // just a little bit #if (R_maior < R_menor) #local X=R_maior; #local R_maior=R_menor; #local R_menor=X; #end #if (Angulo < 0) #local Negativ_Flag = 1; #local Angulo = -Angulo; #else #local Negativ_Flag = 0; #end #if (Angulo >= 360) #local Angulo = mod (Angulo, 360); #end intersection{ cylinder { <0,0,0>,<0,Altura,0>, R_maior } cylinder { <0,-D,0>,<0,Altura+D,0>, R_menor inverse } #if (Angulo > 0) // ------------------------------------------------------ #if (Angulo >= 180) union{ #end box { <-R_maior+D,-D,0>,< R_maior+D, Altura+D, R_maior+D> rotate<0,0,0> } box { <-R_maior+D,-D,-R_maior+D>,< R_maior+D, Altura+D,0> rotate<0,-Angulo,0> } #if (Angulo >= 180) } #end #if (Negativ_Flag = 0) rotate<0,Angulo,0> #end #end //------------------------------------ #declare Random_3 = seed (Angulo*R_maior); #declare Random_4 = seed (Angulo*R_menor); #declare Random_5 = seed (Angulo*Altura); //------------------------------------ pigment{ color rgb < 1*rand(Random_3), 1*rand(Random_4), 1*rand(Random_5)> } } #end // FIM DA macro //////////////////////////////////////// // Aqui está a cena, finalmente: union { #include "dados.inc" // SetorCilindro(2, 0.00001, 2, 45) }