MolView Exploratory 3D Molecule Viewer |
Douglas
Cameron |
![]() |
MolView is a free 3D molecule viewer that
demonstrates the numerical and graphical capabilities of the AlphaSquared libraries. Similar capabilities can be
readily built into specialized applications for molecular modeling and dynamics or the
interactive viewing of any three dimensional object. The library is concise and self contained. Its only dependencies are on the C++ Standard Library and the operating system platform for bitmap addressing and rectangular clipping. |
|
| The complete program is available
here as a zipped file. It is a small program that runs on any Windows (95/98/NT/XP)
platform. Download it from the link above and unzip it into any directory. Included with
it are a few sample input files for visualization. The program makes no modifications to your files nor does it use the system registry. Simply deleting its files will remove all traces of it from your system. (more info on downloading) The main C++ file is available here MolView.cpp for those who are interested. |
|
|
|
|
|
|
Running the program
Upon starting MolView it will request a sample geometry (*.geo) file to open. Select one of the smaller example files for the first run. Two windows will then open up: a primary graphical interface and a simple console window with a few bits of additional information.
Standard View: The initial graphic window shows a ball-and-stick model of the molecule. This view is fast and handles large molecules easily.
- Click anywhere in the panel containing the molecule and then use the arrow keys to rotate the image.
- The View Controls panel displays the additional keystrokes that can be used to change the perspective. Most of these use the numeric keypad, e.g. with '-' and '+' to zoom. This panel contains many controls which can be difficult to see on smaller monitors. Expanding the whole application to full screen or expanding the Molecule View panel by clicking on its zoom icon (^) should help.
- If you have red/green 3D-glasses activating 3D mode will give a three dimensional image.
- In addition to the initial Perspective panel, the button labeled Drawing has controls changing the display of bonds, atoms, atomic numbers and bond lengths. The additional Atom Hiding panel is most useful only for hiding portions of very large molecules.
- Panels anywhere in the program can be easily zoomed (small blue icon), moved (with the right mouse button) and stretched (control- right mouse button). More information on the graphical user interface is here.
Surface View: Activating the volume view from the Views selector opens a second panel that can draw the molecular surface with a space filling view. This view is closer to reality but a bit slower to manipulate.
- Turn off the Standard View with the Views selector and expand the Surface View to full screen to avoid too much clutter at first.
- Clicking on Compute Surface begins the process of computing the molecular surface which may take a few seconds. Increasing the grid size (click and enter new number then click compute surface) improves the visual quality but processing time increases rapidly with the grid size (n3). A bit of patience may be required as this can take a bit of processing time for a complex molecule. During processing the button will remain depressed.The default setting is blockish but computes quickly.
- The
same controls are available for this view as with the Standard View but there are additional panels with settings for presenting a 3D surface grid or a shaded surface with lighting. These settings are under the Painter Control panel.
- The initial mode is a wire frame (grid pattern: full) that has no shading but allows for faster rotation than other modes.
- Turning off the grid and turning on surface mode: Shaded gives the appearance of a solid surface.
- Surface mode lighting is initially quite dark. Due to historical reasons, the starting light location is on the right towards the back. This can be adjusted when the view panel itself is selected by changing the light direction using shift and the arrow keys.
- Turning off all triangles hides the backward facing surface for the simplest view.
- The surface definition panel allows the surface to be defined with or without atoms and bonds.
All panels can be easily zoomed (small blue icon), moved (with the right mouse button) and stretched (control- right mouse button). More information on the graphical user interface is here.
File formats
Geo file format: This is a simple text format that can easily be extracted from other common molecular geometry file formats. Examples are included in the zipped file above. The format is simply this:
| Hemoglobin by x-ray diffraction | First line is a comment line. |
| 1.65 | Second line is the maximum bond length. Atoms closer than this are considered bonded. |
| H 1.0654 1.0654 1.0654 | <atom name or atomic #> x y z coordinates |
| C 2.0123 2.0123 2.0123 | continue for every atom in molecule |
| O 0.9876 0.9876 0.9876 | |
| ... | |
Filters for a few common file formats (e.g. PBD from Protein Data Bank) are available on request.
Due to the poor security in Microsoft's operating systems it is generally not a good idea to execute an untrusted application. We look forward to the day when safe 'sandboxes' are available on Windows and hope that Microsoft's new .Net begins to achieve this. That being said, we can only offer our assurance that this program is in no way malicious. It reads only the requested file and is not capable of writing any files. It also has no interaction with any network ports. If it is of any consolation here is the main C++ file: MolView.cpp. We would be glad to answer any further questions and, if asked, would show you the rest of the source code as well.
Related links:
Geometric Tools for Computer Graphics, Philip J. Schneider, David H. Eberly (book)
The Visualization ToolKit (VTK) is a C++ open source 3D graphics and visualization library.