Zoom In/Out by Moving Camera

This section provides a tutorial on how to zoom in and zoom out on the molecule structure by changing the camera location (origin of camera rotation) in PyMol.

If we understand the PyMol viewing parameter correctly, we should be able to zoom in and zoom out on molecule structure by changing the camera location (origin of camera rotation).

After loading the molecule from Molecule-HY-001.sdf, we know that the origin of camera rotation (location of the camera) is automatically adjusted to (0.0, 0.0, -17.18). So if we move it half way towards the screen at (0.0, 0.0, -8.0), the molecule will probably enlarged about twice of the original size to get the zoom in result.

With the camera moved, we also need to move the slabs (clipping planes in the camera direction) to 0.0 and 1000.0 respectively to ensure that the molecule is located between the slabs.

Run the following "set_view" command with changed viewing parameters described above. You should see the molecule enlarged, the zoom in result.

set_view (\
     1.000000000,    0.000000000,    0.000000000,\
     0.000000000,    1.000000000,    0.000000000,\
     0.000000000,    0.000000000,    1.000000000,\
     0.000000000,    0.000000000,   -8.000000000,\
     0.876923084,   -0.289230824,    0.000000000,\
     0.000000000, 1000.000000000,  -20.000000000 )

If you want to zoom out on the displayed structure, you can move the camera location away from the screen by changing the origin of camera rotation to (0.0, 0.0, -36.0), run the following "set_view" command:

PyMOL>set_view (\
     1.000000000,    0.000000000,    0.000000000,\
     0.000000000,    1.000000000,    0.000000000,\
     0.000000000,    0.000000000,    1.000000000,\
     0.000000000,    0.000000000,  -36.000000000,\
     0.876923084,   -0.289230824,    0.000000000,\
     0.000000000, 1000.000000000,  -20.000000000 )

Table of Contents

 About This Book

 Introduction of Molecules

 Molecule Names and Identifications

 Protein and Amino Acid

 Nucleobase, Nucleoside, Nucleotide, DNA and RNA

 Gene and Chromosome

 Protein Kinase (PK)

 SDF (Structure Data File)

 RDKit: Open-Source Cheminformatics Software

 PyMol Installation

PyMol GUI and CLI

 PyMol Screen Layout

 Load Molecule from File into PyMol

 Virtual Trackball Rotation on PyMol

 Zoom In and Out on PyMol

 PyMol Command Line Interface

 "load" and "delete" Commands on PyMol

 "log_open" and "log_close" Commands on PyMol

 Model Space and Camera Space on PyMol

 "get_view" and "set_view" on PyMol

 View Parameters Auto Adjusted on PyMol

Zoom In/Out by Moving Camera

 Rotation with Transformation Matrix

 Rotation with "turn" Command

 Difference of "turn" and "rotate" Commands

 Difference of "move" and "translate" Commands

 "center", "zoom" and "reset" Commands

 Model-to-Camera Space Coordinates Mapping

 Camera-to-Model Space Coordinates Mapping

 Turn Structure around Camera

 "show lines" Presentation Command

 "show sticks" Presentation Command

 "show spheres" Presentation Command

 "show surface" Presentation Command

 "show mesh" Presentation Command

 PyMol Selections

 PyMol Editing Functions

 PyMol Measurement Functions

 PyMol Movie Functions

 PyMol Python Integration

 PyMol Object Functions

 ChEMBL Database - European Molecular Biology Laboratory

 PubChem Database - National Library of Medicine

 PDB (Protein Data Bank)

 INSDC (International Nucleotide Sequence Database Collaboration)

 Resources and Tools

 Molecule Related Terminologies

 References

 Full Version in PDF/EPUB