#declare X_RES = 35; // number of points in x direction #declare Y_RES = 35; // number of points in y direction #declare C_SQUARED = 0.3; // c^2 constant in wave equation #declare DT = 0.1; // the time step // declare the arrays for the wave height and velocity // and two for temporary values #declare waveHeight = array[X_RES][Y_RES]; #declare waveVelocity = array[X_RES][Y_RES]; #declare waveHeightT = array[X_RES][Y_RES]; #declare waveVelocityT = array[X_RES][Y_RES]; // initialise the arrays to zero #local X=0; #while(X up z right x*4/3 angle 40 sky z look_at <.5,.5,0> } union{ #local X=1; #while(X <(X-1)/X_RES,Y/Y_RES,waveHeight[X-1][Y]> 0.1/X_RES } cylinder{ 0.1/X_RES } #local Y=Y+1; #end #local X=X+1; #end pigment{ gradient z color_map{ [0.0 color rgb <0,1,1>] [0.5 color rgb <1,1,0>] [1.0 color rgb <1,0,0>] } translate -z/2 scale 0.5 } finish{ specular 0.5 roughness 0.01 } }