// Persistence of Vision Ray Tracer Scene Description File
// File: .pov
// Vers: 3
// Desc: Mountain heightfield with ocean
// Date: January 4, 1998
// Auth: J. Jason Sims

// ==== Standard POV-Ray Includes ====
#include "colors.inc"	// Standard Color definitions
#include "textures.inc"	// Standard Texture definitions

// Places a camera in the scene.
camera
{
  location  <1.50 , 23 ,-10.0>
  look_at   <4 , 22.5 , 5.0>
}

// create a regular point light source
light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-1.5, 200, 45>
}

// create a regular point light source
light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <5, 200, 0>
}

//The following texture declaration is a color map.  It gives the heightfield mountain
//a graduated color from green at its base to an earthy brown to a snowy white.

#declare texture004 = texture
{
  pigment
  {
    gradient <0,1,0>  // this line directs the color map to be gradient in the "y" or vertical direction.
    color_map
    {
      [0.00 color rgb<0.039, 0.455, 0.149>]
      [0.22 color rgb<0.027, 0.596, 0.180>]
      [0.44 color rgb<0.427, 0.420, 0.224>]
      [0.54 color rgb<0.427, 0.420, 0.224>]
      [0.74 color rgb<0.514, 0.506, 0.388>]
      [0.80 color rgb<0.596, 0.627, 0.651>]
      [1.00 color rgb<0.910, 0.929, 1.000>]
    }
  }
}

// Creates a natural looking haze on the horizon
fog {color White distance 1550 }

// Creates a sphere with a sky texture on it.
#declare Mysky = sphere {
  <0,0,0>,0.98
  texture {
    Blue_Sky3
    finish {reflection 0.0 diffuse 0.0 ambient 1.0}
  }
}

// Subtracts the inside of the above declared sphere.
// This shell leaves a realistic sky to encapsulate the scene.
difference {
    sphere { <0,0,0>,1}
    object {Mysky}
    scale <3000,500,3000>
	// NOTE: The uneven scaling makes the sky sphere
	// wider and deeper than it is tall.  This makes the
	// sky appear to fade off into the distance.  The
	// standard sky sphere appears too one-dimensional.
     texture {
          Blue_Sky3  // applies the Blue Sky texture to the resulting shell.
          finish {reflection 0.0 diffuse 0.0 ambient 1.0}
     }
     no_shadow
	// The "no_shadow" directive allows you to place the light source
	// outside the shell by eliminating the shadow it would cast.
}

// The following defines a deep blue color for the water.  The ripples are
// created by the"waves" statement in the "normal" attribute and the
// reflectivity is due to statements in the "finish" attribute.
#declare Sea = texture
{
  pigment
  {
    colour rgbf<0.298,0.055,0.596,0.267>
  }
  normal
  {
    waves 0.12
    turbulence 1.38
    frequency 3
  }
  finish {
    diffuse 0.62
    brilliance 1.5
    specular 0.26    roughness 0.14
    phong 0.2    phong_size 75
    reflection 0.12
    refraction 1.0    ior 1.333
  }
}

// The following creates an infinite plane used for the water in the scene.
// The "Sea" texture declared above is used here.
plane { y, 9.0
      texture { Sea }
      }

// The following describes the heightfield.
// The image used to generate the heightield was created with a great program called
// Fractint.  Use a program like Fractint to build a 256 color plasma fractal.  The resulting 
// GIF file is then read by POV-Ray and the heights in the heightfield are determined by
// the index number in the GIF's color pallette.
// 
height_field {
       gif "c:\images\plasma.gif"	// This line tells POV-Ray where to find
				// the image used to draw the heightfield
       smooth	// "smooth" can be left out or included to create a much smoother 	
       heightfield                         
       water_level .1	// Instructs POV-Ray not to draw below this point as it would be
			// obscured from view.  Useful for scenes such as this one.

       texture { texture004 }	// This calls the color map declared above.
       translate <-.5, 0, 0>
       scale <50, 25, 50>
       rotate <0, 0, 0>
       }

Back to Raytracing Page.