#version 3.5; /////////////////////////////////////////////////////////////////////// // THIS IS THE SIMPLE PIGMENT THAT IS USED TO // MAKE ALL THE ISOSURFACES. IT'S JUST THE // CRACKLE PATTERN. /////////////////////////////////////////////////////////////////////// // The pigment #declare cells_pigment = pigment { crackle color_map {[0.0 color rgb 1] [0.3 color rgb 0] [1.0 color rgb 0]} rotate 60 } // The pigment as a function #declare fun_pig = function { pigment {cells_pigment} } // The pigment as a single-valued function #declare fun_val = function { fun_pig(x,y,z).red } /////////////////////////////////////////////////////////////////////// // Row 1 // Three very similar isosurfaces with very different // results. Only the accuracy setting is changed. // // // 1A. accuracy 0.001 // Accurate enough to show the "real" isosurface // isosurface { function { .95-fun_val(x,y,z)} contained_by { box { -1, 1 } } accuracy 0.001 max_gradient 7 texture { pigment {color rgb 1 } finish {ambient 0.1 diffuse 0.75 specular .75 roughness .05 } normal {granite .2 scale .5} } translate <-2.5,2.5,0> } // // 1B. accuracy 0.1 // Accuracy is "too low". This produces a cool organized // web/net structure. // isosurface { function { .95-fun_val(x,y,z)} contained_by { box { -1, 1 } } accuracy 0.1 max_gradient 7 texture { pigment {color rgb 1 } finish {ambient 0.1 diffuse 0.75 specular .75 roughness .05 } normal {granite .2 scale .5} } translate <0,2.5,0> } // // 1C. accuracy 0.5 // Accuracy is "way too low". This produces a cool // disorganized cobweb structure. // isosurface { function { .95-fun_val(x,y,z)} contained_by { box { -1, 1 } } accuracy 0.5 max_gradient 7 texture { pigment {color rgb 1 } finish {ambient 0.1 diffuse 0.75 specular .75 roughness .05 } normal {granite .2 scale .5} } translate <2.5,2.5,0> } /////////////////////////////////////////////////////////////////////// // Row 2 // Other uses of the same pattern. // // // 2a: use the pattern as a pigment. // object { box { -1,1 } texture { pigment { cells_pigment } finish {ambient 0.6} } translate <-2.5,0,0> } // // 2b: use the pattern as a media density // object { box { -1,1 } pigment {rgbt 1} hollow interior { media { absorption rgb 1 emission rgb 1 method 3 density { function {fun_val(x,y,z)*fun_val(x,y,z)*fun_val(x,y,z)} } } } translate <0,0,0> } // // 2c: use the pattern as the basis for a pigment map // object { box { -1,1 } texture { pigment { cells_pigment color_map { [0.0 color rgbt <1,1,1,0>] [0.05 color rgbt 1] [1 color rgbt 1] } } finish {ambient 0.8} } interior_texture { pigment { cells_pigment color_map { [0.0 color rgbt <1,1,1,0>/3] [0.05 color rgbt <1/3,1/3,1/3,1>] [1 color rgbt 1] } } finish {ambient 0.6} } translate <2.5,0,0> } /////////////////////////////////////////////////////////////////////// // Scene setup stuff... /////////////////////////////////////////////////////////////////////// global_settings {assumed_gamma 1.0 } light_source {<10,10,-60> color rgb 1} sky_sphere {pigment {color rgb <0.015,0.015,.3>}} camera { right x*image_width/image_height location <0,2.5/2,-7> look_at <0,2.5/2,0> //// THE FOLLOWING CAMERA LOCATION IS ALSO VERY FUN. //// IT'S IN THE MIDDLE OF THE LOW ACCURACY //// ISOSURFACE, AND SHOWS REALLY COOL STRUCTURES. //location <0,2.5,0> //look_at <0,2.5*3,0> }