This is a read-only mirror of pymolwiki.org

Difference between revisions of "Rotate"

From PyMOL Wiki
Jump to navigation Jump to search
(Added "Arguments" according to source)
 
(Tried to clarify the object option)
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
'''rotate''' can be used to rotate the atomic coordinates of a molecular object.  Behavior differs depending on whether or not the '''object''' parameter is specified.
 
'''rotate''' can be used to rotate the atomic coordinates of a molecular object.  Behavior differs depending on whether or not the '''object''' parameter is specified.
 
   
 
   
If object is '''None''', then rotate rotates the atomic coordinates according to the axes and angle for the selection and state provided.  All presentation geometries will need to be regenerated to reflect the new atomic coordinates.
+
If object is '''None''', then rotate rotates the atomic coordinates according to the axes and angle for the selection and state provided.   
  
If object is set to an object name, then selection and state are ignored and instead of translating the atomic coordinates, the object's representation display matrix is modified. This option is for use in animations only.
+
If object is set to an object name, then selection and state are ignored and instead of translating the atomic coordinates, the [[Object_Matrix|object matrix]] is modified. This option is intended for use in animations.
 +
 
 +
The "camera" option controls whether the camera or the model's axes are used to interpret the translation vector.  To move the object relative to the camera set '''camera=1''' (which is default), or to move the molecule relative to the model's geometry, set '''camera=0'''.
  
 
If this doesn't do what you want, consider [[Turn]].
 
If this doesn't do what you want, consider [[Turn]].
  
 
===USAGE===
 
===USAGE===
rotate axis, angle [,selection [,state [,camera [,object [,origin]]]]]
+
<source lang="python">
 +
rotate axis, angle [,selection [,state [,camera [,object [,origin]]]]]
 +
</source>
  
 
===ARGUMENTS===
 
===ARGUMENTS===
    axis = x, y, z, or float vector: axis about which to rotate
+
'''axis'''
    angle = float: degrees of rotation
+
::x, y, z, or float vector: axis about which to rotate
    selection = string: atoms whose coordinates should be modified {default: all}
+
 
    state > 0: only the indicated state is modified
+
'''angle'''
    state = 0: all states are modified
+
::float: degrees of rotation
    state = -1: only the current state is modified {default}
+
 
    camera = 0 or 1: is the axis specific in camera coordinates? {default: 1}
+
'''selection'''
    object = string: object name (only if rotating object matrix) {default: None}
+
::    string: atoms whose coordinates should be modified {default: all}
    origin = float vector: origin of rotateion {default: None}
+
::    state > 0: only the indicated state is modified
 +
::    state = 0: all states are modified
 +
::    state = -1: only the current state is modified {default}
 +
::    camera = 0 or 1: is the axis specific in camera coordinates? {default: 1}
 +
::    object = string: object name (only if rotating object matrix) {default: None}
 +
::    origin = float vector: origin of rotateion {default: None}
  
 
===PYMOL API===
 
===PYMOL API===
Line 35: Line 44:
  
 
===SEE ALSO===
 
===SEE ALSO===
[[Translate]] [[Turn]]
+
[[Object_Matrix|object matrix]] [[Translate]] [[Turn]] [[Model_Space_and_Camera_Space]]
  
  
 
[[Category:Commands|Rotate]]
 
[[Category:Commands|Rotate]]
 
[[Category:States|Rotate]]
 
[[Category:States|Rotate]]

Revision as of 11:22, 7 September 2010

rotate can be used to rotate the atomic coordinates of a molecular object. Behavior differs depending on whether or not the object parameter is specified.

If object is None, then rotate rotates the atomic coordinates according to the axes and angle for the selection and state provided.

If object is set to an object name, then selection and state are ignored and instead of translating the atomic coordinates, the object matrix is modified. This option is intended for use in animations.

The "camera" option controls whether the camera or the model's axes are used to interpret the translation vector. To move the object relative to the camera set camera=1 (which is default), or to move the molecule relative to the model's geometry, set camera=0.

If this doesn't do what you want, consider Turn.

USAGE

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

ARGUMENTS

axis

x, y, z, or float vector: axis about which to rotate

angle

float: degrees of rotation

selection

string: atoms whose coordinates should be modified {default: all}
state > 0: only the indicated state is modified
state = 0: all states are modified
state = -1: only the current state is modified {default}
camera = 0 or 1: is the axis specific in camera coordinates? {default: 1}
object = string: object name (only if rotating object matrix) {default: None}
origin = float vector: origin of rotateion {default: None}

PYMOL API

cmd.rotate(list-or-string axis, angle=0, string selection = "all", int state = 0,
           int camera = 1, string object = None)

EXAMPLES

rotate x, 45, pept
rotate [1,1,1], 10, chain A
Electrostatic Map Caveat

If you have an electrostatic map and it's not rotating with the molecule as you expect it to, see the Turn command. Turn moves the camera and thus the protein and map will be changed.

SEE ALSO

object matrix Translate Turn Model_Space_and_Camera_Space