The following sections explain the features in roughly the same order as they are described in the reference chapter.
This kind of coordinate system is called a left-handed coordinate system. If you use your left hand's fingers you can easily see why it is called left-handed. Just point your thumb in the direction of the positive x-axis, your index finger in the direction of the positive y-axis and your middle finger in the positive z-axis direction. You can only do this with your left hand. If you had used your right hand you would not have been able to point the middle finger in the correct direction.
The left hand can also be used to determine rotation directions. To do this you must perform the famous Computer Graphics Aerobics exercise. Hold up your left hand. Point your thumb in the positive direction of the axis of rotation. Your fingers will curl in the positive direction of rotation. Similarly if you point your thumb in the negative direction of the axis your fingers will curl in the negative direction of rotation.
In the above illustration, the left hand is curling around the x-axis. The thumb points in the positive x direction and the fingers curl over in the positive rotation direction.
If you want to use a right-handed system, as some CAD systems such as AutoCAD do, the right vector in the camera specification needs to be changed. See the detailed description in "Handedness" . In a right-handed system you use your right hand for the Aerobics .
Note that there is some controversy over whether POV-Ray's method of doing a right-handed system is really proper. If you want to avoid problems we suggest you stick with the left-handed system which is not in dispute.
The first include statement reads in definitions for various useful colors. The second include statement reads in some useful shapes. The next read pre-defined finishes, glass, metal, stone, and wood textures. When you get a chance, have a look through them to see but a few of the many possible shapes and textures available.
You should only include files you really need in your scene. Some of the include files coming with POV-Ray are quite large and you should better save the parsing time (and memory) if you don't need them. In the following examples we will only use the colors.inc , finish.inc and stones.inc include files so you'll better remove the appropriate lines from your scene file.
You may have as many include files as needed in a scene file. Include files may themselves contain include files, but you are limited to declaring includes nested only ten levels "deep".
Filenames specified in the include statements will be searched for in the current directory first and, if not found, will then be searched for in directories specified by any +L or Library_Path options active. This would facilitate keeping all your "include" ( .inc ) files such as shapes.inc , colors.inc , and textures.inc in an "include" subdirectory, and giving an +L option on the command line to where your library of include files are.
Add the following camera statement to the scene.
Briefly, location <0,2,-3> places the camera up two units and back three units from the center of the ray-tracing universe which is at <0,0,0>. Remember that by default +z is into the screen and -z is back out of the screen.
Also look_at <0,1,2> rotates the camera to point at x, y, z coordinates <0,1,2>. A point 5 units in front of and 1 unit lower than the camera. The look_at point should be the center of attention of your image.
The first vector specifies the center of the sphere. In this example the x coordinate is zero so it is centered left and right. It is also at y=1 or 1 unit up from the origin. The z coordinate is 2 which is 5 units in front of the camera, which is at z=-3. After the center vector is a comma followed by the radius which in this case is 2 units. Since the radius is half the width of a sphere, the sphere is 4 units wide.
The color you define is the way you want it to look if fully illuminated. If you were painting a picture of a sphere you would use dark shades of a color to indicate the shadowed side and bright shades on the illuminated side. However ray-tracing takes care of that for you. You pick the basic color inherent in the object and POV-Ray brightens or darkens it depending on the lighting in the scene. Because we are defining the basic color the object actually has rather than how it looks the parameter is called pigment .
Many types of color patterns are available for use in a pigment {... } statement. The keyword color specifies that the whole object is to be one solid color rather than some pattern of colors. You can use one of the color identifiers previously defined in the standard include file colors.inc .
If no standard color is available for your needs, you may define your own color by using the color keyword followed by red , green and blue keywords specifying the amount of red, green and blue to be mixed. For example a nice shade of pink can be specified by:
The values after each keyword should be in the range 0.0 to 1.0. Any of the three components not specified will default to 0. A shortcut notation may also be used. The following produces the same shade of pink:
Colors are explained in more detail in section "Specifying Colors" .
Table Of Contents