Difference between revisions of "Transform selection"

From PyMOLWiki
Jump to navigation Jump to search
(New page: == Overview == '''transform_selection''' applies a transformation matrix to a selection. == Example == <source lang="python"> cmd.transform_selection("a", [[x,x,x,x],[x,x,x,x],[x,x,x,x],[...)
 
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
'''transform_selection''' applies a transformation matrix to a selection.
+
'''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 column and 4th row specify the pre- and post-translation vectors.  So, you can translate+rotate+translate with this one matrix.
  
 
== Example ==
 
== Example ==

Revision as of 14:49, 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 column and 4th row 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