"get_position" - Viewing Center

This section provides a tutorial on how to use the 'get_position' command to see the viewing center location in the model space in PyMol.

If you want to know the camera viewing center location in the model space, you can run the "get_position" command.

For example, the following PyMol session shows the viewing center is located at the center of the methane molecule by default:

PyMOL>delete all
PyMOL>load Carbon-Atom.sdf
PyMOL>h_add

PyMOL>get_position
 cmd.get_position: [   0.840,  -1.030,  -0.000]

PyMOL>get_extent id 1
 cmd.extent: min: [   0.840,  -1.030,   0.000]
 cmd.extent: max: [   0.840,  -1.030,   0.000]

But if the camera is moved, the viewing center is moved accordingly in the opposite direction:

PyMOL>move x, 0.2

PyMOL>get_position
 cmd.get_position: [   0.649,  -0.971,   0.010]

PyMOL>get_extent id 1
 cmd.extent: min: [   0.840,  -1.030,   0.000]
 cmd.extent: max: [   0.840,  -1.030,   0.000]

Of course, we can translate the entire molecule back to match the viewing center:

PyMOL>translate [-0.2, 0.0, 0.0]
PyMOL>get_position
 cmd.get_position: [   0.649,  -0.971,   0.010]
PyMOL>get_extent id 1
 cmd.extent: min: [   0.649,  -0.971,   0.010]
 cmd.extent: max: [   0.649,  -0.971,   0.010]

Table of Contents

 About This Book

 Introduction of Molecules

 Molecule Names and Identifications

 Molecule Mass and Weight

 Protein and Amino Acid

 Nucleobase, Nucleoside, Nucleotide, DNA and RNA

 Gene and Chromosome

 Protein Kinase (PK)

 DNA Sequencing

 Gene Mutation

 SDF (Structure Data File)

 PyMol Installation

 PyMol GUI and CLI

 PyMol Selections

 PyMol Editing Functions

PyMol Measurement Functions

 "get_extent" - Picked Atom Location

 "label" - Generate Labels on Atoms

 Distance between Atoms in PyMol

 Angle Formed by 3 Atoms in PyMol

 Dihedral Angle Formed by 3 Atoms in PyMol

 Use Selection Expressions in PyMol

 "get_area" - Surface Areas of Atoms

 Surface Area of Bonded Atoms

 Surface Area of Entire Molecule

"get_position" - Viewing Center

 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)

 HGNC (HUGO Gene Nomenclature Committee)

 Relocated Tutorials

 Resources and Tools

 Molecule Related Terminologies

 References

 Full Version in PDF/EPUB