// ====================================================================== // 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_A = texture{ pigment{ color rgb <0.5, 0.5, 1.00 > } } #declare tx_B = texture{ pigment{ color rgb <1.0, 0.5, 0.50 > } } #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} } #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 4.0 } // ====================================================================== // DESCRIÇÃO DA CENA #declare PHI=(sqrt(5)-1)/2; #macro plane_pairs_z(dir,r, textu) #if (dir.z = 0) plane { < dir.x, dir.y, dir.z>, r texture { textu } } #else plane { < dir.x, dir.y,+dir.z>, r texture { textu } } plane { < dir.x, dir.y,-dir.z>, r texture { textu } } #end #end #macro plane_pairs_y(dir,r, textu) #if (dir.y = 0) plane_pairs_z( < dir.x, dir.y, dir.z>, r, textu) #else plane_pairs_z( < dir.x,+dir.y, dir.z>, r, textu) plane_pairs_z( < dir.x,-dir.y, dir.z>, r, textu) #end #end #macro plane_pairs_x(dir,r, textu) #if (dir.x = 0) plane_pairs_y( < dir.x, dir.y, dir.z>, r, textu) #else plane_pairs_y( <+dir.x, dir.y, dir.z>, r, textu) plane_pairs_y( <-dir.x, dir.y, dir.z>, r, textu) #end #end #macro plane_pairs(dir,r, textu) plane_pairs_x(dir, r, textu) #end #macro d12(textu) intersection { plane_pairs( < 1 , 0 ,PHI>, 1, textu ) plane_pairs( , 1, textu ) plane_pairs( < 0 ,PHI, 1 >, 1, textu ) bounded_by { sphere { <0,0,0>, 2 } } } #end #macro d4(textu) #declare V0 = <0,0,-1>; #declare V1 = vrotate(V0, ); #declare V2 = vrotate(V1, <0, 0, 120> ); #declare V3 = vrotate(V1, <0, 0,-120> ); intersection { plane { V0, 1 texture { textu } } plane { V1, 1 texture { textu } } plane { V2, 1 texture { textu } } plane { V3, 1 texture { textu } } bounded_by { sphere { <0,0,0>, 3 } } } #end #macro d6(textu) intersection { plane_pairs( <1,0,0>, 1, textu ) plane_pairs( <0,1,0>, 1, textu ) plane_pairs( <0,0,1>, 1, textu ) bounded_by { sphere { <0,0,0>, 2 } } } #end #macro d8(textu) intersection { plane_pairs( <1, 1, 1>, 1, textu ) plane_pairs( <1, 1,-1>, 1, textu ) plane_pairs( <1,-1, 1>, 1, textu ) plane_pairs( <1,-1,-1>, 1, textu ) bounded_by { sphere { <0,0,0>, 2 } } } #end object { d4(tx_vidro) translate <-4,-2, 0> } object { d6(tx_vidro) translate <-4,+2, 0> } object { d8( tx_vidro) translate < 0,-2,0> } object { d12(tx_vidro) translate < 0,+2, 0> } intersection { //Suportamente um icosaedro d12(tx_vidro) object {d8 (tx_vidro) scale 0.907 } translate <4,-2,0> } intersection { //Cubo AND Octaedro - 8 triangulos + 6 quadrados d8(tx_vidro) object {d6 (tx_vidro) scale 0.87 } translate <4,+2,0> } plane { <0,0,1>, -2 texture { tx_xadrez } } #include "camlight.inc" #declare centro_cena = <0,0,0>; #declare raio_cena = 10; #declare dir_camera = <1,1,1>; #declare dist_camera = 10; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)