Raytracing follows the camera metaphor. That is, you have a camera for taking a picture of a scene which contains several objects. The positions of the camera and objects are represented by world coordinates. POVRAY uses a left-handed coordinate system. If the lower-left corner of your screen is considered to be the origin of a 3D coordinate system, then the x-axis is the bottom edge of your screen with its positive direction running from left to right, the y-axis is the left edge of your screen with its positive direction running from bottom up, and the z-axis is the line perpendicular to the screen with its positive direction running away from you (i.e., pointing into your monitor).
To specify a camera, you need the following:
camera { location < a, b, c > direction < a, b, c > up < a, b, c > right < a, b, c > look_at < a, b, c > // Optional }
In the above, < a, b, c > is a vector in space giving a position; camera, location, direction, up, right and look_at are reserved keywords; and anything following // is a comment. Blank lines are allowed and treated as comments.
Vectors up and right also define the size, or aspect-ratio, of your film. If the length of up is the height, the length of right is the width of your film. In general, we would choose up and right to be unit-length vectors and multiply right by the aspect ratio.
For example, the aspect ratio of the VGA standard is 4/3. Then, you could use up = < 0, 1, 0 > and right = 4/3 * < 1, 0, 0 >.
For your convenience, POVRAY has three predefined vectors: x, y and z. They are the unit-length vectors pointing to the positive directions of the corresponding axes. In fact, x=<1,0,0>, y=<0,1,0> and z=<0,0,1>.
You can add two vectors and subtract a vector from another. For example, <3, 4, 5> + <4, 5, 6> gives <7, 9, 11> and <3, 4, 2> - <6, 2, 9> gives <-3, 2, -7>. POVRAY also allows you to use +, -, * and / for a number and a vector.
Another problem is that you get a black screen. This could be: (1) your camera is in the inside of an object, or (2) the length of vector direction is wrong. This requires some explanation.
Consider the following camera definition:
The camera is at < 0, 0, -10> with a direction vector < 0, 0, 3 >. Vectors up and right are < 0, 1, 0 > and < 4/3, 0, 0 >, respectively. This camera is pointing in the positive z-direction. There is a sphere with center at the origin and radius 1.camera { location -10*z direction 3*z up y right 4/3*x }
The result is shown in the middle figure. If we change the length of vector direction from 3 to 1, 2, 3, 4 and 5, we shall get the above five figures from left to right. Thus, increasing the length of direction has the effect of moving the object closer (i.e., telephoto effect). At the same time, some surrounding objects will not be seen as the length of direction increases. Therefore, you should start with a moderate length of direction and increase it if there is too much background, or decrease it if some desired objects are not seen. Or, you might consider moving camera as well.