POV-Ray : Documentation : 1.2.1.6 Defining a Light Source
  POV-Ray 3.6 Documentation Online View  
1.2.1.5 Adding Texture to an Object   1.2.2 Basic Shapes

1.2.1.6 Defining a Light Source

One more detail is needed for our scene. We need a light source. Until we create one, there is no light in this virtual world. Thus we add the line

  light_source { <2, 4, -3> color White}

to the scene file to get our first complete POV-Ray scene file as shown below.

  #include "colors.inc"
  background { color Cyan }
  camera {
    location <0, 2, -3>
    look_at  <0, 1,  2>
  }
  sphere {
    <0, 1, 2>, 2
    texture {
      pigment { color Yellow }
    }
  }
  light_source { <2, 4, -3> color White}

The vector in the light_source statement specifies the location of the light as two units to our right, four units above the origin and three units back from the origin. The light source is an invisible tiny point that emits light. It has no physical shape, so no texture is needed.

That's it! We close the file and render a small picture of it using whatever methods you used for your particular platform. If you specified a preview display it will appear on your screen. If you specified an output file (the default is file output on), then POV-Ray also created a file.

Note: if you do not have high color or true color display hardware then the preview image may look poor but the full detail is written to the image file regardless of the type of display.

The scene we just traced is not quite state of the art but we will have to start with the basics before we soon get to much more fascinating features and scenes.

1.2.1.5 Adding Texture to an Object   1.2.2 Basic Shapes


Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.