This section describes how to create a scene using POV-Ray's scene
description language and how to render this scene.Note: this is the Povray-tutorial of the Povray-Team. I just made the html-version and added the pictures. You can find the complete povray-documentation here. In that directory, you will also find the rest of the povray-distribution.
^+Y
| /+Z
| /
| /
|/ +X
|-------->
The negative values of the axes point the other direction, as follows:
^+Y
| /+Z
| /
| /
-X |/ +X
<-------|-------->
/|
/ |
/ |
-Z/ |
v-Y
#include "colors.inc" // The include files contain
#include "shapes.inc" // pre-defined scene elements
#include "textures.inc"
camera {
location <0, 2, -3>
look_at <0, 1, 2>
}
The first include statement reads in definitions for various useful colors.
The second and third include statements read in some useful shapes and
textures respectively. When you get a chance, have a look through them to
see but a few of the many possible shapes and textures available.
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 10 "deep".
Filenames specified in the include statements will be searched for in the
home (current) directory first, and if not found, will then be searched for
in directories specified by any "+L" (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.
sphere {
<0, 1, 2>, 2
texture {
pigment {color Yellow} // Yellow is pre-defined in COLORS.INC
}
}
The first vector specifies 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 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 1/2 the width of
a sphere, the sphere is 4 units wide.
color red 1.0 green 0.8 blue 0.8
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:
color rgb <1.0, 0.8, 0.8>
Colors are explained in more detail later.
light_source { <2, 4, -3> color White}
The vector specifies the location of the light as 2 units to our right, 4
units above the origin and 3 units back from the origin. The light_source
is invisible, it only casts light, so no texture is needed.
That's it! Close the file and render a small picture of it using this
command:
POVRAY +W160 +H120 +P +X +D0 -V -Ipicture1.pov
If your computer does not use the command line, see the executable docs for
the correct command to render a scene.
You may set any other command line options you like, also. The scene is
output to the image file DATA.TGA (or some suffix other than TGA if your
computer uses a different file format). You can convert DATA.TGA to a GIF
image using the commands listed in the docs included with your executable.
And here's what you get.
Last modified: Tue Oct 8 12:29:08 1996