// ---------------------------------------- // To see the real isosurface: // #declare approximateISO = no; // To produce a smooth_triangle approximation: // #declare approximateISO = yes; #declare isoSmooth = yes; // To produce a flat triangle approximation: // #declare approximateISO = yes; #declare isoSmooth = no; // ---------------------------------------- #include "functions.inc" //#declare Fn = function { f_torus(x, y, z, 1, 0.4) } //#declare Fn = function { y - sin(2*x*z)*cos(x*z) } #declare Fn = function { cos(2*pi*x) + cos(2*pi*y) + cos(2*pi*z) } #declare isoThreshold = 0.0; // Set to yes to produce the approximation // or to no for actual isosurface #declare approximateIso = yes; #declare R = 2.0; #declare isoMin = -<1, 1, 1>*R; #declare isoMax = +<1, 1, 1>*R; #if (approximateIso) #declare Depth = 1; // Set to 0 for no recursion #declare isoSmooth = no; #declare isoSegs = <1, 1, 1>*6; #declare isoFileOption = 1; #declare isoFile = "triangles.inc"; #declare isoName = "Surface"; // #declare f = Fn; #include "isosurface.inc" // #include "isosurfaceJF9.inc" // #include "isosurf_KL_JF.inc" #include "isosurface_KL_JF_TOK.inc" object { Surface pigment { color rgb <1, 1, 1>*0.9 } finish { phong 0.5 phong_size 10 } } #else isosurface { function { Fn(x, y, z) } max_gradient 8.0 contained_by { box { isoMin, isoMax } } open pigment { color rgb <1, 1, 1>*0.9 } finish { phong 0.5 phong_size 10 } } #end // if // ---------------------------------------- sky_sphere { pigment { function { abs(y) } color_map { [ 0.0 color rgb <0.0, 0.0, 0.6> ] [ 1.0 color rgb <1.0, 1.0, 1.0> ] } } } camera { location <1, 2, -4>*2*R look_at <0, 0, 0> angle 32 } light_source { <1, 2, -1>*100 color rgb <1, 1, 1> shadowless } light_source { <-1, -2, -1>*100 color rgb <1, 1, 1>*0.5 shadowless } // ----------------------------------------