POV Ray 3.7 code //========================================== // Random Mandelbrot mountain landscape // generation (POV-Ray 3.7 small spheres) //========================================== #include "colors.inc" // Standard Color definitions #include "glass.inc" // Glass pigments #include "metals.inc" // Metal pigments global_settings {assumed_gamma 1.0} // set display gamma #declare Th = -40; // set rotation angles #declare Ph = 10; background { color red 0.2 green 0.6 blue 0.8 } plane { < 0.0, 1, 0.0 >, 1 // normal vector to palne | -1 is the height of the floor pigment { color .3*Green } normal { bumps 0.5 scale 0.6} // grass effect rotate < 0, Th, Ph > } camera { // set view point (camera) location location <0, 100, -220> look_at <20, 10, 0> } light_source // create a regular point light source { 0*x // light's position (translated below) color Gold // light's color translate <1000, 1000, -100> } light_source // Area light source (creates soft shadows) { 0*x // light's position (translated below) color Silver // light's color // nLightsWide mLightsHigh area_light <8, 0, 0> <0, 0, 8> // 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 translate <40, 80, -40> // position of light } #declare R = 0.5; // set radius value #declare L = 2; // set square area side #declare X = 0; // set co-ordinate x initial value #declare Y = 0; // set co-ordinate y initial value #declare n = 400; // alternative value n = 200 // set number of pixels per area side #declare N = 20; // set number of cycles #declare K = array[n+1][n+1]; // image point matrix #for (p, 0, n, 1) // partial values 0, n/4, n/2 #for (q, 0, n, 1) #declare X = 0; #declare Y = 0; #declare K[p][q] = 0; #for (k,0,N) #declare XX = X*X - Y*Y + 2*p*L/n - L - 1; #declare YY = 2*X*Y + 2*q*L/n - L; #declare X = XX; #declare Y = YY; #if (X*X+Y*Y < R+.01) #declare K[p][q] = k; #end // end if #end // end for k #end // end for q #end // end for p #declare Rnd_1 = seed (1153); // random number generators #declare Rnd_2 = seed (553) ; // replace n*n by n*n*clock for animation #for(j,0,n*n) // partial values n*n/64, n*n/16, n*n/4 #declare p = int(n*rand(Rnd_1)); #declare q = int(n*rand(Rnd_2)); #for(i,0,K[p][q]) sphere { < p-n/2, i, q-n/2 >, 1 hollow radiosity { importance 1.0 } texture { pigment { color rgb < abs(sin(.5*pi*i/N)), 0.3, abs(cos(.5*pi*i/N)) > } } finish { ambient rgb <0.3,0.1,0.2> diffuse .3 reflection .3 specular 1 } rotate < 0, Th, Ph > translate < 0, 0, 0 > } #end // end for i #end // end for j