Behind the scenes - About Pov-Ray

The models of biological organisms, the spaceships (e.g. Starstrider and Plutonium), planets (e.g. with our planet
builder and also planetscapes), other astrophysical objects, abstract art, robots and aliens were mostly rendered
with Pov-Ray. First of all understand what Pov-Ray is and how these images were made: they were not simply drawn
with a graphical user interface (GUI), as you would draw in MS Paint say, rather lines of computer code were written
telling the computer which shapes to draw, how to arrange them and how to colour them and where to position the
light and the camera. In short, these images were generated from mathematical formulae. This makes things tough -
you have to be inventive in order to get the shapes that you desire. One cannot simply say 'draw a human sitting
down'! One would have to describe each geometric shape comprising the human figure. Pov-Ray uses its own
C-style scripting language.

This is quite different to how professional graphics packages, like the ones used to draw characters for computer
games, such as 3D Max, operate. These use a GUI, so if you click on the icon to draw a sphere the sphere will
appear on the screen and then you can then click on it and distort its shape, change its size etc. Now, in Pov-Ray a
sphere really is a sphere (at least to the nearest pixel!) - it is generated from a mathematical formula for a sphere. In
GUI packages you get an approximate sphere, approximate because it is actually made up of a mesh of triangles.
You can make the sphere look smoother by using more and smaller triangles to construct it. The advantage of this
is that all the computer needs to know (as far as geometry is concerned) are the coordinates of each corner of each
triangle. By clicking and dragging on any such corner you can distort the shape at will and see the results
immediately displayed on your computer screen. Thus, with a bit of artistic skill and mouse control, it is fairly easy to
generate complex shapes, like the shapes that make up real animals or people. Pov-Ray can use meshes too, but
the problem is that it does not have a GUI to generate the coordinates from. It would be an impossible task to
generate the coordinates for a complex shape with pencil and paper!

It is possible to use another package to generate the mesh and obtain the coordinates and then enter these into
Pov-Ray. So far at Cronodon we have deliberately not gone down this route. That's not to say that we won't try this
in future, especially if we want say a realistic dragon (several of which can be purchased as pre-designed meshes
and modified by the way). This way can certainly create very spectacular and realistic looking graphics! However, as
a mathematician and computer programmer (amongst other things) Bot likes to experiment from first principles - it is
quite a challenge to make a horse graphic from simple geometrical shapes that can be modelled with simple
equations. It is also often pleasantly surprising when one writes a piece of computer code (using Pov-Ray's own
scripting language) and then waits a few minutes, or even hours, whilst the computer draws (renders) it as one can
never be quite sure what the end result will look like. (Of course one can tweak the code, try a number of different
techniques and then select the most satisfactory result at the end). Pushing this kind of graphical generation
technique as far as we can is one of our aims at Cronodon. It is, if you like, a mathematical approach to art!
Solar Sanctum 1
Solar Sanctum 2
Solar Sanctum 3
Above: scenes from inside a Solar Sanctum, generated with Pov-Ray. Pov-Ray is probably the
easiest graphics package to use for generating nice scenes which involve such simple geometries.
Behind the Scenes: Pov-Ray
Apart from the aesthetic satisfaction of generating scenes from first mathematical principles (for some of us!)
Pov-Ray does offer other advantages - it's free, simply download it from the Internet and begin learning assisted by
the accompanying manual, examples and tutorials. It is also ideal for generating images that do require simple
geometries. You will be surprised how much artwork can be generated using just a simple sphere!

The purpose of this section is not to explain how to use Pov-Ray, there are many lengthy tutorials and much
documentation available online that does that! Rather it is intended to demonstrate some of its features so that
visitors may appreciate what is involved in producing the graphics for www.cronodon.com. The information will also
be of use to the computer minded who wishes to use Pov-Ray to reproduce some of these graphics or use similar
effects in other original graphics.

Consider, for example, the code for the Ankaragian mothership:
click here for this code.
Note one has to have a camera in order to see anything at all! Tell the computer where to position the camera and
where to point it and what type of camera to use (e.g. what width of view to use).

Then one must have some lights to see anything but darkness! This scene has several lights, some of them can be
switched off by enclosing them in comments (i.e. /* ... */) depending upon the effects desired.

Then one must have an object to look at! This is the spaceship which is actually a simple one to make in Pov-Ray
since it consists of simple geometric shapes like spheres, cylinders and cones. Pov-Ray can generate much more
sophisticated shapes, but I will show you those another time, or you can try
Pov-Ray and find out for yourself. (And
you thought my models were rubbish because I couldn't draw with my mouse!).

Some people have done remarkable things with Pov-Ray. Some people have produced images of things, like the
inside of a room, which look like photographs of the real thing! This is great for advancing computer graphics
technology, after all the techniques that they develop can be used in virtual reality simulation or video games.
However, from an artistic point of view and I personally am less-impressed by technically impressive realism and I
am more impressed by composition and abstractness. I like pictures of things that I can not see myself and simply
take a photo of. For example, on the Pov-Ray Web site you will find great images of abstract art and realistic
images of things we can not see, like an old alchemy lab. However, one does not have to be a world-class artist, as
are these people, to appreciate Pov-Ray. IO often like to experiment with simple things and alter the lighting to
generate nice effects.

Pov-Ray works in a way that simulates nature. It builds the objects and then shines light on them and then traces
the light-rays to see how they get absorbed, reflected, dispersed or refracted. Using Pov-Ray teaches one a lot of
physics about light! For example if you shine white light on to an object made of red glass, then mostly only the red
part of white light gets transmitted by the glass, the rest is absorbed. Some light will also be reflected by the glass,
giving you sparkling highlights. Some light will also be refracted by the glass.
Click here to learn about refraction and reflection in Pov-Ray.

Here are some more examples of Pov-Ray code that was written by Bot to generate some of the images on this site:

Pov-Ray source code for a bacteriophage virus. (See this graphic in its context).

Pov-Ray source code for UGA Starstrider. (See this graphic in its context).


Notice that the virus source code contains expressions like:

#declare index = 1;
#while (index <=10)

cylinder { <0,-11,0>, <0,-12,0>, 3 texture {pigment { color Cyan} finish {ambient 0.1 diffuse 0.1 reflection 0.25
specular 1 roughness 0.001 } }
scale <0,0,0> rotate <0,0,0> translate <0,-2*index,0>}

#declare index = index + 1;
#end

This is an example of a while-loop. The hash # symbol indicates a special instruction that is not directly part of the
scene, #declare index = 1; assigns a variable (an object that can take varying values) called 'index' the value of
one. The code draws a cylinder and then positions it according to the value of 'index' in a translate statement (in
geometry to translate something means to slide it along in a given direction). Next the value of index is incremented
by adding one to itself, making index = 2. Now 'while' the value of index is less than or equal to (<=) 10, the
computer keeps drawing cylinders (it loops through the 'cylinder' instruction) and translating them from the same
starting point vertically downwards by a value equal to twice the index value, and adds one to index each time, and
continues to do so until index = 10. Thus, we have told the computer to draw ten cylinders in a vertical stack, one
on top of the other. This forms the 'tail' of the virus.

One could instead write out ten separate 'cylinder' instructions specifying the varying positions of each cylinder, but
the while-loop is a shorthand version of this which makes code easier to write, to read and to debug. Loops of
various kinds are widely used throughout computer programming.

Constructing complex shapes from primitives

All computer graphics systems use a series of basic shapes as building blocks, these shapes are called
primitives. Primitives include shapes that have simple mathematical formulae, which makes them ideal for
computers to generate, such as spheres, boxes, cones, prisms, tori and cylinders. The trick is how to use these
simple shapes to build more complex shapes.

Sphere-sweeps: Looking at the UGA Starstrider source code, you will see that the ship's hull was made from an
object called a sphere-sweep. A sphere-sweep is simply the shape generated by moving a sphere from one
position to another, through a series of intermediate positions as specified by a list of coordinates. (Specifically the
sphere will be swept over a mathematical curve or
spline, calculated as a fit to the coordinates given). To add
flexibility, the sphere can be made to change size at each intermediate position. The computer generates a smooth
shape that joins all these intermediate spheres together. Similar a
cone-sweep will construct a smooth shape
joining a series of cones together. There is actually more than one way that Pov-Ray can smooth the final shape. In
the Starstrider example we used a b_spline which is a type of curve that gives a nice curvy shape, ideal for a ship's
hull. Sphere-sweeps are particularly useful for generating the shapes of living organisms.
Unicorn
The Unicorn on the left, was generated from cylinders,
spheres and cones and so is really the representation
of a set of mathematical formulae! A more realistic
geometry would be more easily obtained using a mesh
in 3D Max (especially a horse mesh commercially
supplied). However, I personally like the look of
'unreality' that this technique generates - this is meant
as a computer model of a mythical creature and not a
photograph of the real thing! With time, such a model
could be refined by adjusting its geometry, but rather
than spend extraordinary lengths of time perfecting a
single graphic, at Cronodon we generally prefer to
achieve a certain standard and then move on to the
next exhibit - our museum intends to cover a wide
range of topics.
Most of the computer graphics on Cronodon were developed from computer code
using Pov-Ray which has its own graphical computer language. Click on these
thumbnails to see more examples. See more Pov-Ray
robots.
Constructive solid geometry (CSG): the trouble with our sphere_sweep is that it has given us a shape that is
completely symmetric about the long axis - the hull is curved equally on the top half as it is on the bottom half. What
was done was that a box was subtracted from the top-half, and thereby removing it completely and leaving a
top-deck. This is the
difference construct that you can see in the code - a difference subtracts one or more
shapes or objects from the first object listed. Objects can also be added together in a
union or all regions except
where one or more objects overlap can be removed in an
intersection (for example an intersection of two
overlapping spheres gives a lens shape). There is also a
merge construct which ignores regions where objects in
the collection overlap, which is useful when using transparent objects, otherwise the interfaces of the objects
become visible. This procedure of adding, subtracting or overlapping objects is called solid constructive geometry
(CSG) and is one of the most useful and most powerful features of Pov-Ray.

Blobs: a blob is a shape formed by joining together two or more spheres and/or cylinders in a controlled way such
that the overall shape likes curvy and blobby. This creates very good organics effects and blobs are useful when
creating graphics that represent living things, including human figures. I will show you some examples shortly (the
cellularslime mould and Malosian trooper both used blobs).


Coming soon: how to use Pov-Ray to make slime-creatures and also how to use Pov-Ray to make stars and
nebulae and other astrophysical effects.

For information or source code for graphics for which the source has not been given, email Bot at
BotRejectsInc@cronodon.com.

Click here to view a gallery of abstract 'modern art' resulting from Pov-Ray experiments.
Helix
Tentacle
See how to use sphere-sweeps to
generate organic shapes like helices
and tentacles!
Battle Drone
Hot Star
Simulating laser beams with particle
behaviour and media.
Simulating stars with particle behaviour
and media. See more Pov-Ray
stars.
Dawn!
Oak tree
3D Trees with the TomTree Pov-Ray
add-on.
Planet
Modelling planets.
See more Pov-Ray aliens.
See more Pov-Ray animals.
sunrise