POV Quick Guide

Andy Harris
3/27/01

Introduction

POV is a very powerful (yet free) Ray-Tracing Engine. This tutorial is meant as a quick introduction to the most powerful features of this incredible program. I'm concentrating on the Windows version of the software, but the language remains similar in the other versions as well.

The basic scene

Every scene in POV has three required elements. The easiest way to remember them is with the old Hollywood line: "Lights, Camera, Action." Just like a movie set, a POV scene requires a light source (or two), a camera (to define the user's position in the scene), and some objects to look at (the 'action' of the scene). Here's perhaps the simplest legal POV scene:
//simple.pov
//Andy Harris

#include "colors.inc"

light_source { 
  <0, 3, -15>
  color White
} // end light source

camera {
  location <0, 1, -3>
  look_at <0, 0, 0>
} // end camera

sphere {
  <0, 0, 0>, 1
  pigment { color White }
} // end sphere
If you wish to view this or any of the pages in this tutorial, just copy and paste the text into your own copy of pov-ray and hit the run button.
The program generates a simple white sphere on a black background. While it seems like a lot of work for such a simple display, this basic program demonstrates all the major features of POV-Ray, and by extension the basic principles of ray tracing and 3D rendering.

Examining the light

The light source is a simple but very important object. This allows you to place light in your scene. If you do not include at least one light source, your scene will be completely dark, and you won't see anything at all. (It's easy to forget this step.) The basic form of the light source requires two parameters.

The first is simply the location of the light source. Locations in POV-Ray are treated as 3D vectors. The vector <0, 3, -5> means place the light at an x value of zero (neither left nor right of the origin), a Y value of 3 (three units up from the origin) and a z value of -5 (five units back from the origin). POV-ray is heavily reliant on vectors for positioning things, so it's a good idea to get used to them quickly. Shortly you'll get to experiment with this concept. If you want to try now, that's great. Just play with the values in this vector and see what happens to the shading of the sphere.

The second parameter is the color of the light. Colors can get complicated in ray tracing, so we'll start with some pre-defined colors. Notice that I had the line #include "colors.inc" near the top of the file. This tells pov-ray to incorporate a pre-defined set of colors. Later we will explore exactly what that means, but for now its OK to know that you can generally use a color name when you have to place a color somewhere. The color names are usually capitalizes. In this case, I decided to go for a white light. Feel free to try other colors here, and see what happens.

camera

The next required element in a POV-Ray scene is the camera. Ray tracing works by tracing a light ray from the camera off or through any objects in the scene, and back to any light sources. In order to do all its calculations, the program must have a camera position and a light source. The interesting thing about a camera in ray tracing is that you can easily change the camera position. If you want to see what your scene will look like from another angle, all you have to do is change the camera angle.

Cameras have two required parameters, location and look_at. Both of these parameters require vectors. Here's what the camera definition I put in simple.pov means:
camera {
  location <0, 1, -3>
  look_at <0, 0, 0>
} // end camera
The location is set to <0, 1, -3>, which is head on in the x axis, 1 unit up in y, and three units back on Z. Of course I can change this if I want (and you should, to see what happens). The look_at vector is used to determine where the camera is pointed. At the moment I want to look directly at the origin, so I point the camera at the origin (<0, 0, 0>). As always, feel free to play around with this value to see what happens

The sphere object

Now that you have a light source and a camera, you really ought to have something to look at. A sphere would be interesting, so here is one:
sphere {
  <0, 0, 0>, 1
  pigment { color White }
} // end sphere
The sphere is an example of a primitive shape. Just like 2D artists combine basic shapes like lines and circles to generate complex objects, 3D artists use basic three dimensional shapes to do the same work. The sphere is reasonably simple to make. It has a center and a radius. I decided to place my sphere at <0, 0, 0> (the origin) and give it a radius of one.

Technically, the center and radius are all that is required of a sphere object, but if you tried to render the image now, you still wouldn't see anything interesting. We need to describe the characteristics of the sphere in order for the renderer to know how light will bounce off of it. Minimally, we need to specify a color for the sphere. I did that in this line: pigment { color White } Pigmentation is actually a sort of complicated issue which we'll deal with in more detail later. It's easy enough to see the basics from this example, though. If you want to add color to an object, add a line like this. Of course, you can change the term 'White' to any color you wish. (If you want to know all the color names you can use, open up the file 'colors.inc' in the include directory of POV-Ray. It has a list of all the colors. )