Transform selection: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
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 | 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 17: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)