Visualizing molecules in Cinema 4D

I've been experimenting recently with visualizing molecules in Cinema 4D, Maxon Computer's excellent 3D animation software.

These experiments have been inspired by the exceptional work of David Goodsell of Scripps Research Institute, and the author of The Machinery of Life (a book I can't recommend highly enough) and the new Bionanotechnology: Lessons from Nature. He also writes and illustrates the fascinating Molecule of the Month at the Protein Data Bank.

QuickTime 3 or later is necessary to view the movies on this page.

The QuickTime VR on the left represents human insulin (PDB entry). Clicking and dragging left and right rotates the molecule; dragging up and down switches between various ways of visualizing the molecule.

The default view is similar to the views produced in many molecular modeling programs (though I have using soft shadows rather than the more common hard shadows).

Dragging up reveals views where the atoms have been textured with various shaders built in Cinema 4D. The outline effect is the result of using the Bhodinut's fresnel shader in the luminance channel (fresnel affects the surface based on the local surface normal's relation to the camera vector). Colour and shadows have been added as separately rendered passes.

Dragging downward reveals views where the basic outline of the molecule and atoms are derived from a depth map. This is based on David Goodsell's methods. The depth map is manipulated in After Effects by running the Find Edges and Levels filters, resulting in an image that simplifies and clarifies the structure, and which, as a side benefit, looks less computer-generated than other methods. Colour and shadows are then added as separately rendered passes, composited in After Effects.

Methods: There are numerous molecular modeling and viewing applications available; a listing can be found at the Protein Data Bank. I use a Mac, and until recently the options under Mac OS X were somewhat limited; fortunately, there are now a number of Mac OS X molecular modeling/viewing apps, including:

  • UCSF Chimera - A very well-rounded molecular modeler/viewer, with the very useful multiscale model feature for creating rough approximations of very large protein surfaces. It requires that the X Window system be installed. The latest developer build has VRML export. (Many thanks to Morgan Ryan for pointing out this great app).
  • iMol - currently lacks VRML export
  • VMD - has VRML export
  • The Swiss PDB viewer - alpha version for Mac OS X
  • Pymol - 90 day evaluation license; no VRML export

Unfortunately, the wonderful Weblab Viewer Lite, which used to be free download from MSI, seems no longer to be available. It was a Mac OS Classic-only program, but it was fast and generated clean export files. It seems to have been replaced by the commercial (and Windows only) DS Viewer Pro. If you can find a copy of the late lamented Weblab Viewer Lite, it still works well under Classic. Alex Morla recently wrote to comment that Molview (http://bilbo.bio.purdue.edu/~tom/), another mac-based molecular manipulation program, will save in 3DMF format, which is also importable by Cinema4D.

  1. Search PDB for molecules, and download. View in MSI's free Weblab Viewer Lite; export as "VRML image file", change the three letter file extension to "wrl".
  2. If importing VRML format, set factor to 10 in Cinema 4D's "Import/Export" preferences for VRML 1 and VRML 2. This will scale up the molecule as it is imported.
  3. Open WRL file in Cinema 4D.
  4. If two material tags have been attributed to your objects, delete one of them. I find that the first tag is the reliable one; it indicates the element for each atom.
  5. Use the simple imported textures as the basis for your textural experimentations. Do not delete the imported textures; they are the only thing that will distinguish oxygen from nitrogen, etc.
  6. In order to create the computer-generated hand-drawn look a la David Goodsell, you must render a depth map. Insert a camera in the scene. Select the camera, and in the attribute manager enable depth of field (front). Visually set the front depth and focus depth for the camera to encompass your molecule. In the render settings dialog, under the "Multipass" tab, add an "RGBA image" channel and a "Depth" channel. Give the file a name, and render to picture viewer.
  7. In Photoshop (for stills) or After Effects (animations) run find edges on the depth map image(s). Then use levels to clean up the result.

Nick Woolridge

updated: March 22, 2004