Make a new file called image.pov and edit it to contain the following:
The hf_gray_16 keyword causes the output to be in a special 16 bit grayscale that is perfect for generating height fields. The normal 8 bit output will lead to less smooth surfaces.
Now create a camera positioned so that it points directly down the z-axis at the origin.
Then create a plane positioned like a wall at z=0. This plane will completely fill the screen. It will be colored with white and gray wrinkles.
Finally, create a light source.
Render this scene at 640x480 +A0.1 +FT . You will get an image that will produce an excellent height_field.
Now we will use this image to create a height field. Create a new file called hfdemo.pov and edit it as follows:
Add a camera that is two units above the origin and ten units back ...
... and a light source.
Now add the height field. In the following syntax, a Targa image file is specified, the height field is smoothed , it is given a simple white pigment, it is translated to center it around the origin, and it is scaled so that it resembles mountains and fills the screen.
Save the file and render it at 320x240 -A . Later, when you are satisfied that the height field is the way you want it render it at a higher resolution with antialiasing.

Wow! The Himalayas have come to your computer screen!
Almost every object can be approximated using triangles but you may need a lot of triangles to create more complex shapes. Thus we will only create a very simple mesh example. This example will show a very useful feature of the triangles meshs though: a different texture can be assigned to each triangle in the mesh.
Now let us start. We'll create a simple box with differently colored sides. Create an empty file called meshdemo.pov and add the following lines.
We must declare all textures we want to use inside the mesh before the mesh is created. Textures cannot be specified inside the mesh due to the worser memory performance that would result.
Now add the mesh object. Three sides of the box will use individual textures while the other will use the "global" mesh texture.
Trace the scene at 320x240. You'll see that the top, right, and front side of the box have different textures. Thought this is not a very impressive example it shows what you can do with mesh objects. More complex examples, also using smooth triangles, can be found under the scene directory as chesmsh.pov and robotmsh.pov .
A polygon is defined by a number of points that describe its shape. Since polygons have to be closed the first point has to be repeated at the end of the point sequence.
In the following example we will create the word POV using just one polygon statement.
We start with thinking about the points we need to describe the desired shape. We want the letters to lie in the x-y-plane with the letter O being at the center. The letters extend from y=0 to y=1. Thus we get the following points for each letter (the z coordinate is automatically set to zero).
Letter P (outer polygon):
<-0.8, 0.0>, <-0.8, 1.0>,
<-0.3, 1.0>, <-0.3, 0.5>,
<-0.7, 0.5>, <-0.7, 0.0>
Letter P (inner polygon):
<-0.7, 0.6>, <-0.7, 0.9>,
<-0.4, 0.9>, <-0.4, 0.6>
Letter O (outer polygon):
<-0.25, 0.0>, <-0.25, 1.0>,
< 0.25, 1.0>, < 0.25, 0.0>
Letter O (inner polygon):
<-0.15, 0.1>, <-0.15, 0.9>,
< 0.15, 0.9>, < 0.15, 0.1>
Letter V:
<0.45, 0.0>, <0.30, 1.0>,
<0.40, 1.0>, <0.55, 0.1>,
<0.70, 1.0>, <0.80, 1.0>,
<0.65, 0.0>
Both letters P and O have a hole while the letter V consists of only one polygon. We'll start with the letter V because it is easier to define than the other two letters.
Create a new file called polygdem.pov and add the following text.
As noted above the polygon has to be closed by appending the first point to the point sequence. A closed polygon is always defined by a sequence of points that ends when a point is the same as the first point.
After we have created the letter V we'll continue with the letter P . Since it has a hole we have to find a way of cutting this hole into the basic shape. This is quite easy. We just define the outer shape of the letter P , which is a closed polygon, and add the sequence of points that describes the hole, which is also a closed polygon. That's all we have to do. There'll be a hole where both polygons overlap.
In general you'll get holes whenever an even number of sub-polygons inside a single polygon statement overlap. A sub-polygon is defined by a closed sequence of points.
The letter P consists of two sub-polyons, one for the outer shape and one for the hole. Since the hole polygon overlaps the outer shape polygon we'll get a hole.
After you've understood how multiple sub-polygons in a single polygon statement work, it's quite easy to add the missing O letter.
Finally, we get the complete word POV .

Where r and n are float values greater than zero and less than or equal to one. Let's make a superellipsoid and experiement with the values of r and n to see what kind of shapes we can make.
Create a file called supellps.pov and edit it as follows:
The addition of a gray background makes it a little easier to see our object. Now type:
Save the file and trace it at 200x150 -A to see the shape. It will look like a box, but the edges will be rounded off. Now let's experiment with different values of r and n. For the next trace, try <1, 0.2>. The shape now looks like a cylinder, but the top edges are rounded. Now try <0.1, 1>. This shape is an odd one! We don't know exactly what to call it, but it is interesting. Finally, lets try <1, 1>. Well, this is more familiar... a sphere!
There are a couple of facts about superellipsoids you should know. First, you should not use a value of 0 for either r nor n. This will cause POV-Ray to incorrectly make a black box instead of your desired shape. Second, very small values of r and n may yield strange results so they should be avoided. Finally, the Sturmian root solver will not work with superellipsoids.
Superellipsoids are finite objects so they respond to auto-bounding and can be used in CSG.
Now let's use the superellipsoid to make something that would be useful in a scene. We will make a tiled floor and place a couple of superellipsoid objects hovering over it. We can start with the file we have already made.
Rename it tiles.pov . Edit it so that it reads as follows:
Note that we have added #include "textures.inc" so we can use pre-defined textures. Now we want to define the superellipsoid which will be our tile.
Superellipsoids are roughly 2*2*2 units unless you scale them otherwise. If we wish to lay a bunch of our tiles side by side, they will have to be offset from each other so they don't overlap. We should select an offset value that is slightly more than 2 so that we have some space between the tiles to fill with grout. So now add this:
We now want to lay down a row of tiles. Each tile will be offset from the original by an ever-increasing amount in both the +z and -z directions. We refer to our offset and multiply by the tile's rank to determine the position of each tile in the row. We also union these tiles into a single object called Row like this:
This gives us a single row of 17 tiles, more than enough to fill the screen. Now we must make copies of the Row and translate them, again by the offset value, in both the +x and -x directions in ever increasing amounts in the same manner.
Finally, our tiles are complete. But we need a texture for them. To do this we union all of the Rows together and apply a White Marble pigment and a somewhat shiny refelctive surface to it:
We now need to add the grout . This can simply be a white plane. We have stepped up the ambient here a little so it looks whiter.
To complete our scene, let's add five different superellipsoids, each a different color, so that they hover over our tiles and are reflected in them.

Trace the scene at 320x200 -A to see the result. If you are happy with that, do a final trace at 640x480 +A0.2 .