Modifying POV-Ray Input Files

From CrystalExplorer Wiki
Jump to: navigation, search

Contents

Introduction

CrystalExplorer writes a basic scene-description in a scene.pov file. Most of the common changes to the scene can be made by modifying either scene.pov or parameters.inc.

parameters.inc

Tip: Rendering the surfaces can be time consuming. When manipulating the scene, set the surfaces to be hidden (e.g. ShowSurface0 0) until you have the scene you like then turn them back on.

parameters.inc has been setup to make it easy to modify the following:

  • showing/hiding parts of the scene, for example, surfaces.
  • the camera (how you are looking at the scene)
  • object opacity/transparency
  • the display of both coordinate system axes and unit cell box.

Camera

The y-axis is up. Increasing the y-value of the camera location means you are looking from slightly 'above' the model. The model is placed at the centre of the scene and the position of the camera is specified by CameraPoint.

Coordinate System Axes

These axes are worth including initially to help manipulate the scene. The colors of the axes: red, green, blue, correspond to x, y, z. The positive directions are indicated by the arrows. The "black marks" along the axes correspond to translations of 1 unit. They can be enabled by setting ShowAxes to 1.

scene.pov

Lighting

Increasing the ambient_light setting will reduce shadows, but might wash-out the scene a little.

global_settings {  ambient_light 4.0 }

The directed light source is located at the position of the camera by default.

Creating Animations

Creating the frames of animation is possible by uncommenting the Frame and Clock lines from the scene.ini file. The clock variable is incremented for each frame. For a great tutorial on creating POV-Ray animations, see Friedrich A. Lohmüller's Website.

Including Images

ChemCommCover.png

Images, such as PNG images, can easily be included.

For example, we submitted a cover picture to Chem Comm. which features a surface with a fingerprint plot on the 'floor'. You could do this with any image - the code we used to achieve this is below. Note that you need a transparent background on the image (which is why we've used a PNG image generated from the postscript fingerprint plot).

The fingerprint plot sits just above (0.2 Å) the floor plane, leaving a subtle shadow. You will need to experiment with the translate and scale commands to make the image appear in the right spot.

plane { 
  y, -8.3 
  texture { 
    pigment {
      image_map { 
        png "FloorImage5.png"
	map_type 0
	once
      }
      translate -0.5
      scale <30,30,1>
      rotate -90*x
      translate <1,10,-26>
    }
  } 
}

Links