# Lights, camera, action!

Your most basic scenes will consist of a light source, a camera, and an object. Raytracers such as POV-Ray work by sending “rays” from the camera and following the “rays” through reflection, refraction, and absorption until the rays reach a light source or are lost in shadow. See http://en.wikipedia.org/wiki/Raytracing for a more detailed explanation of what raytracing is. Now, let’s create our first simple scene.

You should have already downloaded POV-Ray for your computer, and started it up. You will most likely have a blank document waiting for you to type your scene description. Scene descriptions in POV-Ray use a very formal “scene description language”. I’ll be using POV-Ray 3.6.1 for Mac OS X in the examples here. The location of menus and menu items will probably be slightly different if you are not using Mac OS X, but the scene description text will be exactly the same no matter what platform you are using.

## Location, location, location!

Just about everything you put into a POV-Ray scene has to have a location. POV-Ray requires you to specify three numbers for each location. These numbers are the distance from an imaginary “origin” which might be thought of as the center of the universe.

A location of “5, 3, 6”, for example, would be a distance of five to the right of the center, a distance of three above the center, and a distance of six behind the center.

If you need to place something to the left of center, below the center, or in front of the center, you’ll use negative numbers: “-3, -9, -6”, for example.

What do those numbers mean in actual distance? It’s an important question, and one you’ll want to think about before you start placing things in your scene. You can decide that the numbers mean meters, feet, inches, miles, or even light-years. I always try to place a note at the top of my scenes reminding me of what the numbers mean.

Because you can move the camera wherever you want, the “center of the universe” is usually not the center of your image.

## Let there be light!

We need a light, a camera, and an object. Let’s do the light first. The first line of our scene will be our reminder about what the numbers for locations mean. Let’s go with meters. If you don’t have an open blank document in POV-Ray, pull down the “File” menu and choose “New”.

//units are in meters

Reminders and notes can be placed anywhere in your text, but must begin with two slashes. The two slashes tell POV-Ray that this line is not an instruction for it to place something within the scene.

You will usually want to put a note or reminder in front of every object, to remind of what their purpose is later.

Our light source is going to need a location and a color. You can have green lights, blue lights, chartreuse lights, if you want. Often, you’ll be using white lights. Colors in POV-Ray are usually specified with specific amounts of red, green, and blue.

//one light source

light_source {

<20, 35, -2>

color rgb <1, 1, 1>

}

This is how most objects in your scene will look in your text. The first line tells POV-Ray what kind of an object it is, followed by an open curly-bracket. The rest of the lines, down to the matching closing curly-bracket, describe that object. Our light source has two lines in its description. The first line is its location, and the second line is its color.

Locations are surrounded by less-than and greater-than symbols. This light source is 20 meters to the right, 35 meters up, and 2 meters towards us.

Because colors are specified using three numbers also, they often will look like locations. Here, we are saying that our color in RGB format is 1 for red, 1 for green, and 1 for blue. Colors range from 0 to 1, so these are the maximum numbers for all three colors. If you remember your color mixes, this makes the color white.

You can have many light sources in your scene, each in different locations, with different colors, and different intensities. The more light sources you have, the longer it will take for POV-Ray to create an image from your scene description.

Light sources cast light on the scene, but they are not themselves visible to the camera.