Turn Structure around Camera

This section provides a tutorial on how to turn molecule structure around camera using the 'rotate' command with rotation origin specified in PyMol.

When you use the "turn" command in PyMol, you are actually turning the camera around a given rotation center in camera space.

By default, this rotation center is set to the center of the molecule structure. So the "turn" command turns the camera around the center of the molecule structure.

In some cases, we want to turn the camera around the camera itself, like how we use a camera in real life. But there is no PyMol to directly support this.

One work around is to use the "rotate" command, which allows you to specify the origin of the rotation. But the "rotate" command changes atom locations in the model space. You need to be careful when using it.

Below is the "rotate" command syntax showing the origin of the rotation origin given as the last argument:

rotate axis, angle[, selection[, state[, camera[, object[, origin]]]]]

Note that the "rotate" works in the model space. The rotation origin must be specified as model space coordinates. So if you want to use the camera (located at [0,0,0] in camera space) as the rotation origin, you need to map [0,0,0] from the camera space to the model space as described in the last tutorial.

The first argument, axis, specifies the rotation axis. It can be x, y, z or a vector like [1,0,0]

The fifth argument, camera, is 1 or 0, indicating the rotation axis is given in camera space or in model space.

Here are some examples of the "rotate" command:

# Rotate all atoms around y-axis in camera space for 30 degrees
rotate y, 30, all, -1, 1
rotate y, 30

# Rotate all atoms around [1,1,0] axis and [1,1,0] center in model space
rotate [1,1,0], 30, all, -1, 0, , [1,1,0]

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 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)

 HGNC (HUGO Gene Nomenclature Committee)

 Relocated Tutorials

 Resources and Tools

 Molecule Related Terminologies

 References

 Full Version in PDF/EPUB