VMD is a 3D graphic display program, mainly used for displaying simple molecular structures, not so much for overly complex 3D models. The graphics behind it are similar to those of a typical 3D modeling or rendering program, but there are some differences. Here we look in more detail at how VMD displays a set of atomic coordinates on the screen, given a set of atomic coordinates. This involves a lot of matrix transformations, which are part of computer graphics, so consider this a study of computer graphics.
We take a simple molecular model as an example:
1 4
2 mol
3 C 0 0 0
4 O 1 0 0
5 C1 0 1 0
6 N 0 0 1
Loading this molecule into the VMD, the VMD displays the following:
Left: set the axis at the lower left; Right: set the axis at the origin
Here we use the tcl script to get several matrices used by VMD
1 > set C [molinfo top get center_matrix]
2 {{1 0 0 -0.25} {0 1 0 -0.25} {0 0 1 -0.25} {0 0 0 1}}
This represents the shift of the origin of the molecular model space with respect to the origin of the world space, and since the origin of the world space is the geometric center of the molecule, it is also the shift of the origin of the molecular model space with respect to its geometric center.
1 > set R [molinfo top get rotate_matrix]
2 {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}}
This is the unit matrix, because we have not done any rotation yet. If the numerator is rotated using the mouse or the rotate command, the rotate_matrix matrix will be changed.
1 > S [molinfo top get scale_matrix]
2 {{1.5 0 0 0} {0 1.5 0 0} {0 0 1.5 0} {0 0 0 1}}
This is the default zoom size, depending on the size of the molecule, and the VMD defaults to an appropriate zoom factor to ensure that the entire molecule is visible. If the mouse wheel is used to zoom in and out, the corresponding matrix will change.
1 > set G [molinfo top get global_matrix]
2 {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}}
This is also the unit matrix, because we have not done any translation yet. If a translation is performed, the global matrix will change. Note that only the translation part of the global matrix works, the rotation part cannot be changed by mouse or menu.
Given a set of atomic coordinates, the origin of the world coordinate system is taken to be the geometric center of the set of atomic coordinates, the orientation of the world coordinate system is the same as the orientation of the atomic model coordinate system, and the camera coordinate system coincides with the world coordinate system, with the X and Y axes inside the screen and the Z axis perpendicular to the screen and outward. This is the default setting for most molecular display programs.
Applications of Visual Molecular Dynamics Software