Ray-tracing Molscript files with POV-Ray

Ray-traced molscript file

How it was made

This image was created from a molscript input file by running molscript_pov to create a POV-Ray input file, which was then fed into the popular ray tracer, POV-Ray.

Molscript_pov (based on Molscript 2.1.2) lives locally at : gere:/usr/local/bin/molscript_pov
and POV-Ray v3.1 lives at : gere:/usr/local/bin/x-povray

To make an image, you create a molscript file in the usual way, run molscript_pov instead of molscript to produce a POV-Ray input file, and then feed this into POV-Ray.
The targa file from POV-Ray can be converted to your favorite format using photoshop, the Gimp, xv, or imconv.+povscript

The whole procedure for the image above was as follows :

% molscript_pov -povray < c10.mols > c10.pov
% x-povray -i c10.pov -o c10.tga +q9 +a +w400 +h400
% imconv c10.tga c10.gif

The +w and +h parameters determine the pixel width and height of the final picture, +q sets the quality level (from 0 to 9) and +a sets anialiasing on. You can leave out both q and a for a quick and dirty picture, otherwise a complex picture can take many minutes to render on the alphas.
If you have text you will need to have a font file in your working directory.
% cp /home/markh/molscript/timrom.ttf .
Or pick it up here.

There are many parameters you can change in the POV-Ray wrapper file, on which you can get information from the on-line manual, or from myriad resources via the POV-Ray homepage.

There is also a home page for povscript.

For final POV_Ray output, try an image size of 1600x1600. Do not try to use non-square output formats, unless you are very, very clever. Also, don't specify a non-square area in your molscript file.

The POV-Ray file that comes out of molscript_pov has by default a perspective projection, which we don't usually want in molecule pictures.
You can switch this feature off by putting the keyword 'orthographic' in the camera declation in the output pov file, as follows :

camera { location <    0.0,    0.0,   65>
direction <0, 0, 1.0>
look_at   <0, 0, 0> 
up y right x
Note that you will then need to change the camera location to get the original viewport back. Normally you will need to increase the distance (from 65 in this case).

Mark Harris, 22 Jun '99

(Image Processing notes)