Floats and Vectors
Values in Povray are specified as floating point
numbers and vectors. The syntax of a vector is:
< float1 , float2 , float3 >
Comments
Comments are denoted by the // symbol and proceed
until the end of the current line (similar to C++ comments).
Camera
Cameras are defined as the following:
camera
{
location < 0 , 0 , 0 >
up < 0 , 1 , 0 >
right < 1.333 , 0 , 0 >
look_at < 0 , 0, -1 >
}
The location field specifies the location of
the camera. The up direction specifies the vector pointing
out of the top of the camera and the right vector specifies the vector
pointing out of the right of the camera. The look_at field determines
which way the camera is facing. While the up and right fields define
the orientation of the camera, they also determine the size of the image
plane. The image plane is located one unit from the camera location.
It has dimensions corresponding to the sizes of the right and up vectors
(centered around the origin). This determines where a specific ray
must for a given pixel.
Point Light Sources
Point lights are the illumination for our scene.
Light sources have no visible shape, rather they provide light for other
objects in the scene. Point lights are defined as follows:
light_source
{ < X , Y , Z > color rgb < r , g , b > }
Where < X , Y , Z > is the light source location
and < r , g , b> is the light source color. The light color also
determines its intensity. For instance, < 0.5 , 0.5 , 0.5 > is
a light source half as bright as < 1 , 1 , 1 >.
Box
The box is an axis aligned bow defined by two
corners:
box
{ < CORNER1 > , < CORNER2 > }
Where < CORNER1 > and < CORNER2 > are vectors
defining the two corners of the box. Corner 1 must be less than corner
2 (in all elements) in order for the box to appear. If one wants
a non axis aligned box, the axis aligned box can be rotated translated
and scaled like all objects.
Sphere
The sphere is defined by a center point and radius:
sphere
{ < CENTER > , RADIUS }
Cone
Cones are defined by two endpoints and two radii:
cone
{ < END1 > , RADIUS1 , < END2 > , RADIUS2 }
Where END1 and END2 define the centers of each
end of the cone and RADIUS1 and RADIUS2 are the radii of the cone at those
endpoints. Therefore the cone does not have to come to a sharp point
at the top and can also designate a cylinder.
Plane
Planes are infinite primitives defined by a normal
and distance:
plane
{ < NORMAL > , DISTANCE }
If the NORMAL is defined as < A , B , C >
and the DISTANCE as D, then the plane satisfies the equation:
A
* x + B * y + C * z = D
Triangle
Triangles are similar to planes except they don't
extend infinitely in all directions. They are usually used to make
more complex objects and are defined by 3 vertices:
triangle
{ < CORNER1 > , < CORNER2 > , < CORNER3 > }
Translation
Translations are defined as relative movements
of an object and are specified by a vector:
translate
< TX , TY , TZ >
Rotation
Rotations are specified in Euler angles around
the coordinate axes. The order of rotation is x axis, then y axis,
then z axis.
rotate
< RX , RY , RZ >
Scaling
Scalings are defined by either a float (uniform
scaling) or a vector (nonuniform scaling):
scale
s
scale
< SX , SY , SZ >
Ambient
Ambient specifies the amount of ambient light
the object receives. This is light scattered from many different
sources and is extremely hard to calculate in practice.
Diffuse
Diffuse specifies the amount of diffuse light
reflected from an object (light reflected in all directions equally).
Specular
Specular specifies the amount of specular reflection
(creates highlights).
Roughness
Roughness specifies the size of the specular
highlight.
Reflection
Reflection specifies the reflection coefficient
of the surface (percentage of light reflected)
Refraction
Refraction turns on refraction for an object
(otherwise pure transmission is used).
Ior
Ior specifies the index of refraction of the
object.