/* -------------------------- Entry: 0011 WWW: http://astronomy.swin.edu.au/~pbourke/fractals/keplerian/ Title: Cavernous Author: Paul Bourke ---------------------------*/ /* Based upon the Octahedral fractal Originally by Hop David */ #declare H = sqrt(2); #declare VP = <0.8,0,H/4>; #declare VL = <0,0,H/6>; camera { location VP up y right x angle 90 sky <0,0,1> look_at VL - VP } #declare I = 0; #declare theseed = seed(555); #while (I < 15) light_source { color rgb 2*<1,1,1> } #declare I = I + 1; #end global_settings { ambient_light <1,1,1> } #declare thetexture = texture { pigment { rgb <0.5,0.5,0.5> } finish { ambient 0.15 brilliance 5 diffuse 0.6 metallic specular 0.80 roughness 1/100 reflection 0.65 } } #declare stage1 = union { //polygon { 5, <-1,-1,0>, <-1,1,0>, <1,1,0>, <1,-1,0>, <-1,-1,0> } triangle { <-1,1,0>, <-1,-1,0>, <0,0,H> } triangle { <-1,-1,0>, <1,-1,0>, <0,0,H> } triangle { <1,-1,0>, <1,1,0>, <0,0,H> } triangle { <1,1,0>, <-1,1,0>, <0,0,H> } } #declare stage2 = union { union { stage1 translate <-1,-1,0> } union { stage1 translate <-1,1,0> } union { stage1 translate <1,1,0> } union { stage1 translate <1,-1,0> } union { stage1 translate <0,0,H> } union { stage1 scale <1,1,-1> translate <0,0,H> } scale 0.5 } #declare stage3 = union { union { stage2 translate <-1,-1,0> } union { stage2 translate <-1,1,0> } union { stage2 translate <1,1,0> } union { stage2 translate <1,-1,0> } union { stage2 translate <0,0,H> } union { stage2 scale <1,1,-1> translate <0,0,H> } scale 0.5 } #declare stage4 = union { union { stage3 translate <-1,-1,0> } union { stage3 translate <-1,1,0> } union { stage3 translate <1,1,0> } union { stage3 translate <1,-1,0> } union { stage3 translate <0,0,H> } union { stage3 scale <1,1,-1> translate <0,0,H> } scale 0.5 } #declare stage5 = union { union { stage4 translate <-1,-1,0> } union { stage4 translate <-1,1,0> } union { stage4 translate <1,1,0> } union { stage4 translate <1,-1,0> } union { stage4 translate <0,0,H> } union { stage4 scale <1,1,-1> translate <0,0,H> } scale 0.5 } #declare stage6 = union { union { stage5 translate <-1,-1,0> } union { stage5 translate <-1,1,0> } union { stage5 translate <1,1,0> } union { stage5 translate <1,-1,0> } union { stage5 translate <0,0,H> } union { stage5 scale <1,1,-1> translate <0,0,H> } scale 0.5 } #declare stage7 = union { union { stage6 translate <-1,-1,0> } union { stage6 translate <-1,1,0> } union { stage6 translate <1,1,0> } union { stage6 translate <1,-1,0> } union { stage6 translate <0,0,H> } union { stage6 scale <1,1,-1> translate <0,0,H> } scale 0.5 } #declare stage8 = union { //union { stage7 translate <-1,-1,0> } //union { stage7 translate <-1,1,0> } union { stage7 translate <1,1,0> } union { stage7 translate <1,-1,0> } union { stage7 translate <0,0,H> } union { stage7 scale <1,1,-1> translate <0,0,H> } scale 0.5 } union { stage8 rotate <20,0,0> texture { thetexture } }