/* -------------------------- Entry: 0022 WWW: Title: Resurrection of Golden Section Author: Thies Heidecke Short Desc.: The object is a fractal of a blob-fractal based on an icosahedron. A bit longer Desc.: The algorithm behind the object is icosahedron-sphere-packing. Imagine you put spheres on the vertices of an icosahedron and scale them so that they touch exactly but don't overlap. These spheres are used as components for a blob to make the basic shape. Now imagine for each sphere a downscaled version of all 12 blob-components but with a negative strength so that they carve some material out of the blob and leave the arch-like structure. This blob-object is now in turn scaled down and copied in the same way as in the sphere-packing. This is done recursively for the typical fractal effect. I also tried an isosurface with a smooth falloff-function instead of the blob-object, because there are some visible edges at the surface where the radius of each component ends. This works quite nice, if you want to try it out switch the IsoBlob-flag to on. I decided to use the blob-object though, because the difference in rendering-speed is enourmous and would've blowed the 10h-limit. ---------------------------*/ // Persistence of Vision Ray Tracer Scene Description File // File: FCC_Icos2.pov // Vers: 3.5 // Desc: Entry for the 'POVRay Fractal Raytracing Contest' : an Icosahedron-inspired Fractal of a Fractal. // Date: April, 15th, 2004 #version 3.5; #declare FB = on; // Focal Blur #declare GlobIllum = on; // Radiosity #declare SmoothShadows = on; // Area Light #declare IsoBlob = off;// replace standard-blob with a similar isosurface which is a bit smoother. Warning: Takes Patience to render ! ! ! #declare TexNormal = on; // Normal-Pattern global_settings { assumed_gamma 1.0 max_trace_level 10 #if(GlobIllum=on) radiosity { pretrace_start 0.04 // start pretrace at this size pretrace_end 0.005 // end pretrace at this size count 200 // higher -> higher quality (1..1600) [35] nearest_count 10 // higher -> higher quality (1..10) [5] error_bound 1.5 // higher -> smoother, less accurate [1.8] recursion_limit 2 // how much interreflections are calculated (1..5+) [3] low_error_factor .9 // reduce error_bound during last pretrace step gray_threshold 0.4 // increase for weakening colors (0..1) [0] minimum_reuse 0.015 // reuse of old radiosity samples [0.015] brightness 0.5//0.6 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 #if(TexNormal=on) normal on // take surface normals into account [off] #end //media on // take media into account [off] //save_file "file_name" // save radiosity data //load_file "file_name" // load saved radiosity data //always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } #end } // Icosaeder - Vertex - Definitions : #declare sqrt5 = sqrt(5.0); #declare h = 1.0/sqrt5; #declare a = 2.0*sqrt((5.0+sqrt5)/40.0); #declare b = 2.0*sqrt((5.0-sqrt5)/40.0); #declare c = (5.0-sqrt5)/10.0; #declare d = (5.0+sqrt5)/10.0; #declare nsr = 4.0/(2.0*sqrt(2.0*(5.0+sqrt5))+4.0); #declare ir = 1.0-nsr; #declare gs = (sqrt5+1)/2; //* #declare P0 = < 0, 0, 0>; #declare P1 = < 0, 1, 0>; #declare P2 = < 0, h, 2*h>; #declare P3 = < a, h, c>; #declare P4 = < b, h, -d>; #declare P5 = <-b, h, -d>; #declare P6 = <-a, h, c>; #declare P7 = < 0,-1, 0>; #declare P8 = < b,-h, d>; #declare P9 = < a,-h, -c>; #declare P10 = < 0,-h,-2*h>; #declare P11 = <-a,-h, -c>; #declare P12 = <-b,-h, d>; //*/ // ---------------------------------------- camera { ultra_wide_angle angle 120 location 2.2*(0.7*P4-0.15*y) direction 1.5*z right x*image_width/image_height look_at <0, 0, 0> rotate 13*y #if(FB=on) aperture 0.015 blur_samples 50 focal_point 0.7*vnormalize(<1.0, 2.5, -4.0>)//<0,0.2,-0.8> confidence 0.999999 variance 1/255 //0 #end } sky_sphere { pigment { gradient y color_map { [0.0 rgb <0.6,0.7,1.0>] [0.7 rgb <0.0,0.1,0.8>] } } } fog { fog_type 2 // 1=constant, 2=ground_fog distance 40 color rgb <143,172,239>/255 fog_offset -0.25 fog_alt 0.3 } light_source { <-30,30,-30> #if(GlobIllum=off) color rgb <1, 1, 1> #else color rgb 0.6*<1,0.7,0.2> #end #if(SmoothShadows=on) area_light <5, 0, 0> <0, 0, 5> 9, 9 adaptive 1 jitter circular orient #end looks_like { sphere { 0*x, 5 pigment { color rgb 1000 } finish{diffuse 0 ambient 1}} } } // ---------------------------------------- #declare SimpleTex = texture { pigment { color rgb 1 } #if(TexNormal=on) normal { //wrinkles 0.3 //scale 1/12 granite 0.08 scale 1/15 } #end finish { diffuse 0.8 ambient 0 phong 0.09 phong_size 10 } } plane { y, -1 texture { //pigment{color rgb 0.7} pigment { bozo scale 0.5 color_map { [0 color rgb 0.2*<94,47,0>/255] [.4 color rgb 0.2*<94,47,0>/255] [.6 color rgb 0.4*<94,47,0>/255] [1 color rgb 0.4*<94,47,0>/255] } //poly_wave 2 warp { turbulence 0.15 octaves 10 omega 0.7 lambda 4.5 } } normal { bozo scale 0.5 slope_map { [0 < 0, 0>] [.4 <.3, 2>] //[.5 <.5,2>] [.6 <.7, 2>] [1 < 1, 0>] } //poly_wave 2 warp { turbulence 0.15 octaves 6 omega 0.7 lambda 3.5 } } } } //#include "functions.inc" //#declare blobcmp = function(x,y,z,r){ -2/(1+exp(3.95*pow(f_r(x,y,z)/r,2))) }; //#declare blobcmp = function(x,y,z,r){ -2/(1+exp(3.95*(x*x+y*y+z*z)/(r*r))) }; #declare blobcmp = function(x,y,z,rr){ -2/(1+exp(3.95*(pow(x,2)+pow(y,2)+pow(z,2))/rr)) }; // cx = center x // cy = center y // cz = center z // S = Strength // CR = Component-Radius // R = Radius // L = Level #macro RecursiveIkosBlob(cx,cy,cz,S,CR,R,L) #if(L=0) #if(IsoBlob=on) S*blobcmp(x-cx,y-cy,z-cz,(CR*R*CR*R))+ #else sphere{, CR*R, S} #end #else #local New_L = L-1; #local New_R = R*nsr; RecursiveIkosBlob(cx ,cy-R*ir ,cz ,S,CR,New_R,New_L) RecursiveIkosBlob(cx ,cy-h*R*ir,cz-2*h*R*ir,S,CR,New_R,New_L) RecursiveIkosBlob(cx-a*R*ir,cy-h*R*ir,cz-c*R*ir ,S,CR,New_R,New_L) RecursiveIkosBlob(cx-b*R*ir,cy-h*R*ir,cz+d*R*ir ,S,CR,New_R,New_L) RecursiveIkosBlob(cx+b*R*ir,cy-h*R*ir,cz+d*R*ir ,S,CR,New_R,New_L) RecursiveIkosBlob(cx+a*R*ir,cy-h*R*ir,cz-c*R*ir ,S,CR,New_R,New_L) RecursiveIkosBlob(cx ,cy+R*ir ,cz ,S,CR,New_R,New_L) RecursiveIkosBlob(cx-b*R*ir,cy+h*R*ir,cz-d*R*ir ,S,CR,New_R,New_L) RecursiveIkosBlob(cx-a*R*ir,cy+h*R*ir,cz+c*R*ir ,S,CR,New_R,New_L) RecursiveIkosBlob(cx ,cy+h*R*ir,cz+2*h*R*ir,S,CR,New_R,New_L) RecursiveIkosBlob(cx+a*R*ir,cy+h*R*ir,cz+c*R*ir ,S,CR,New_R,New_L) RecursiveIkosBlob(cx+b*R*ir,cy+h*R*ir,cz-d*R*ir ,S,CR,New_R,New_L) #end #end #declare IkosBlob = object { #if(IsoBlob=on) isosurface { function { // cx,cy,cz, Strength, Component-Radius, Radius, Level RecursiveIkosBlob(0,0,0, 1 ,gs,1,1) RecursiveIkosBlob(0,0,0, 1-gs,gs,1,2) 0.31 } contained_by{sphere{0,1.0}} max_gradient 6.1 accuracy 0.0002 threshold 0 } #else blob { threshold 0.38 RecursiveIkosBlob(0,0,0, 1 ,gs,1,1) RecursiveIkosBlob(0,0,0, 1-gs,gs,1,2) } #end } #macro RecursiveIkosaeder(cx,cy,cz,R,L) #if(L=0) object{ IkosBlob scale R translate } #else #local New_L = L-1; #local New_R = R*nsr; RecursiveIkosaeder(cx ,cy-R*ir ,cz ,New_R,New_L) RecursiveIkosaeder(cx ,cy-h*R*ir,cz-2*h*R*ir,New_R,New_L) RecursiveIkosaeder(cx-a*R*ir,cy-h*R*ir,cz-c*R*ir ,New_R,New_L) RecursiveIkosaeder(cx-b*R*ir,cy-h*R*ir,cz+d*R*ir ,New_R,New_L) RecursiveIkosaeder(cx+b*R*ir,cy-h*R*ir,cz+d*R*ir ,New_R,New_L) RecursiveIkosaeder(cx+a*R*ir,cy-h*R*ir,cz-c*R*ir ,New_R,New_L) RecursiveIkosaeder(cx ,cy+R*ir ,cz ,New_R,New_L) RecursiveIkosaeder(cx-b*R*ir,cy+h*R*ir,cz-d*R*ir ,New_R,New_L) RecursiveIkosaeder(cx-a*R*ir,cy+h*R*ir,cz+c*R*ir ,New_R,New_L) RecursiveIkosaeder(cx ,cy+h*R*ir,cz+2*h*R*ir,New_R,New_L) RecursiveIkosaeder(cx+a*R*ir,cy+h*R*ir,cz+c*R*ir ,New_R,New_L) RecursiveIkosaeder(cx+b*R*ir,cy+h*R*ir,cz-d*R*ir ,New_R,New_L) #end #end union { RecursiveIkosaeder(0,0,0,1,0) RecursiveIkosaeder(0,0,0,1,1) RecursiveIkosaeder(0,0,0,1,2) RecursiveIkosaeder(0,0,0,1,3) RecursiveIkosaeder(0,0,0,1,4) texture{SimpleTex} }