#include "colors.inc" #include "shapes.inc" #include "math.inc" global_settings { ambient_light rgb .2*<1, 1, 1> // background light // used in global_settings, sets image gamma in relation to display gamma assumed_gamma 1.0 } background {color rgb <.7, .7, .7>} #declare c=1; //speed of waves #declare Lx=1; //dimensions of box #declare Ly=1; #declare nx=2; //order of mode #declare ny=1; #declare amp=.2*cos(2*pi*clock); #declare factorial = function(C) { prod(i, 1, C, i) } #declare Jbes = function(m,xx) { pow(xx/2,m)* (1/factorial(m)+sum(r,1,16, pow(-1,r)/(factorial(r)*factorial(m+r))*pow(xx/2,m)) )} isosurface { function { amp*sin(nx*pi*x/Lx)*sin(ny*pi*z/Ly)-y } // isosurface y = sum of terms above open // don't include bounding box in shape contained_by {box{-1.2*y,x+z+1.2*y}} // dimensions of the bounding box max_gradient 5 accuracy 0.001 // accuracy of calc for surface rendering texture { pigment { // (---surface color---) Blue } /* normal { // (---surface bumpiness---) marble 0.3 // some pattern (and intensity) turbulence 0.5 // some turbulence scale 55*<1,3,1> // transformations }*/ finish { // (---surface finish---) ambient 0.2 specular 0.6 // shiny phong .2 } } } /* camera is far away with narrow FOV to reduce distortion */ camera { location 3*<-.2, .2 ,-1> look_at <.5, 0, .5> angle 20 } // An area light (creates soft shadows) // WARNING: This special light can significantly slow down rendering times! light_source { 0*x // light's position (translated below) color rgb 1.0 // light's color area_light <2, 0, 0> <0, 0, 2> // lights spread out across this distance (x * z) 4, 4 // total number of lights in grid (4x*4z = 16 lights) adaptive 0 // 0,1,2,3... jitter // adds random softening of light circular // make the shape of the light circular orient // orient light translate <0, 20, -4> // position of light } // create a regular point light source light_source { 0*x // light's position (translated below) color rgb <.5,.5,1> // light's color translate 5*<-0, -40, -20> } #declare rim=.005; cylinder { <0, 0, 0>, x*Lx, rim } cylinder { x*Lx, x*Lx+z*Ly, rim } cylinder { x*Lx+z*Ly, z*Ly, rim } cylinder { <0, 0, 0>, z*Ly, rim }