Difference between revisions of "Transform selection"

From PyMOLWiki
Jump to navigation Jump to search
Line 3: Line 3:
  
 
=== Details ===
 
=== Details ===
When '''homogenous == 0''': the matrix needed is a 4x4 matrix, where the upper-left 3x3 quadrant is a typical rotation matrix.  The 4th column and 4th row specify the pre- and post-translation vectors.  So, you can translate+rotate+translate with this one matrix.
+
When '''homogenous == 0''': the matrix needed is a 4x4 matrix, where the upper-left 3x3 quadrant is a typical rotation matrix.  The 4th row and 4th column specify the pre- and post-translation vectors.  So, you can translate+rotate+translate with this one matrix.
  
 
== Example ==
 
== Example ==

Revision as of 18:14, 10 March 2008

Overview

transform_selection applies a transformation matrix to a selection. The matrix should actually be passed in as a single list -- not a list of lists.

Details

When homogenous == 0: the matrix needed is a 4x4 matrix, where the upper-left 3x3 quadrant is a typical rotation matrix. The 4th row and 4th column specify the pre- and post-translation vectors. So, you can translate+rotate+translate with this one matrix.

Example

cmd.transform_selection("a", [[x,x,x,x],[x,x,x,x],[x,x,x,x],[x,x,x,x]],
homogenous=1)

See Also

transform_odb