/* -------------------------- Entry: 0028 WWW: http://www.mcgregorfineart.com Title: Sierpinski Gasket Study Author: Robert W. McGregor A simple study of Sierpinski gaskets and object composition... ---------------------------*/ //============================================================================== // Persistence of Vision Ray Tracer Scene Description File // // File : rwmSierpinski.pov // Version : 3.5 // Description : Variations on a Sierpinski gasket // Date : 4/16/2004 //============================================================================== #version 3.5; default { pigment { color 1/2 } finish { ambient 0 diffuse 0.7 }} #include "colors.inc" //------------------------------------------------------------------------------ // Globals //------------------------------------------------------------------------------ #declare Use_Radiosity = 1; #declare Soft_Shadows = 1; global_settings { assumed_gamma 2.5 #ifdef (Use_Radiosity) radiosity { } #end } //------------------------------------------------------------------------------ // Camera & lights //------------------------------------------------------------------------------ camera { right location <0, 0, -275> look_at <0, -7, 0> angle 30 } light_source { <-75, 75, -500> color White*0.9 + Gold*0.1 #ifdef (Soft_Shadows) area_light <50, 0, 0>, <0, 0, 50>, 10, 10 adaptive 1 jitter #end } light_source { <75, 75, -250> color White*0.2 shadowless } //---------------------------------------------------------------------------------- // The initial trianglar base piece //---------------------------------------------------------------------------------- #declare Base = array[10]; #declare Base[0] = difference { box { <-1, -1, -1>, <1, 1, 1> translate <1, 1, 0> scale <1, 1, 0.25> } box { <-1, -1, -1>, <1.5, 1, 1> translate <1, 1, 0> scale z*0.35 rotate z*60 } box { <-1, -1, -1>, <1.5, 1, 1> translate <1, 1, 0> scale <1, 1, 0.35> rotate z*60 rotate y*180 translate <2, 0, 0> } translate <-1, -0.576, 0> } //------------------------------------------------------------------------------ // Materials, etc. //------------------------------------------------------------------------------ #declare P1 = color rgbt <0.70, 0.55, 0.40, 0.7>; #declare F = finish { ambient 0.30 brilliance 3 diffuse 0.4 metallic specular 0.70 roughness 1/60 reflection 0.25 irid { 0.25 } } #declare M1 = material { texture { pigment { P1 } normal { crackle scale 0.5 } finish {F}} interior { ior 1.5 }} #declare M2 = material { texture { pigment { color Gold*0.9 } normal { bumps turbulence 0.5 scale 0.5 } finish {F}} } #declare M3 = material { texture { pigment { color Gold*0.7 } normal { granite scale 0.5 } finish {F}} } #declare CM_1 = color_map { [0.0 color Black] [0.5 color White*0.15] [1.0 color Red] } #declare M_BG = material { texture { pigment { bozo turbulence 0.5 color_map { [0.0 color Copper*0.1] [0.5 color Copper*0.2] [1.0 color Copper*0.3] } scale 1 } normal { bozo turbulence 0.5 normal_map { [0.0 bumps 0.25 scale 1.1 turbulence 0.25] [1.0 granite 0.5 scale 1 turbulence 0.2] } } finish { specular 0.1 roughness 0.125} } texture { pigment { color rgbf <1,1,1,0.9 >} normal { crackle 1.25 turbulence 0.2 scale 1 } finish { specular 0.2 roughness 0.125} } } //---------------------------------------------------------------------------------- // Meat & Potatoes //---------------------------------------------------------------------------------- #macro Sierpinski(n) #local cnt = 0; union { #while (cnt < n) #declare base_len = base_len*2; #declare Base[cnt+1] = union { object {Base[cnt] translate <0, base_len/2*mult, 0>} object {Base[cnt] translate <-base_len, -base_len/2*mult, 0>} object {Base[cnt] translate } } #local cnt = cnt + 1; #end scale z*10 } #end //---------------------------------------------------------------------------------- // Main Scene //---------------------------------------------------------------------------------- sky_sphere { pigment { bozo turbulence 0.75 color_map { [0.0 color P1*0.1] [0.25 color P1*0.2] [0.75 color P1*0.3] } scale 0.12 rotate y*45 } } // Background plane { z, 20 material { M_BG } } plane { z, 19 material { texture { pigment {rgbt 0.8 } finish {reflection 0.6 specular 0 diffuse 0}} } } #declare mult = 1.732; #declare base_len = 0.5; #declare iterations = 6; Sierpinski(iterations) // Main gasket union{ object { Base[iterations] material { M2 } } object { Base[iterations] scale 0.95 translate z*-10 material { M1 } } object { Base[iterations] scale 0.92 translate z*-20 material { M1 } } object { Base[iterations] scale 0.88 translate z*-30 material { M3 } } object { Base[iterations] scale 0.84 translate z*-40 material { M1 } } object { Base[iterations] scale 0.81 translate z*-50 material { M1} } } // Satellite gaskets #declare Satellite1 = object { Base[4] material { M2 } scale z*15 rotate z*180} #declare Satellite2 = object { Base[3] material { M3 } scale z*10 rotate z*180} #declare Satellite3 = object { Base[2] material { M2 } scale z*5 rotate z*180} #declare Satellite4 = object { Base[1] material { M3 } scale z*5 rotate z*180} #declare Satellite5 = object { Base[0] material { M2 } scale z*5 rotate z*180} object { Satellite1 translate <-35, 40, 10>} object { Satellite1 translate <35, 40, 5> } object { Satellite2 translate <-51, 4, 10>} object { Satellite2 translate <51, 4, 5> } object { Satellite3 translate <-59, -13, 11>} object { Satellite3 translate <59, -13, 0> } object { Satellite4 translate <-64, -23, 12>} object { Satellite4 translate <64, -23, 0> } object { Satellite5 translate <-67.5, -29, 13>} object { Satellite5 translate <67.5, -29, 0> }