Moves, scales, or rotates one or more objects given a 4x4 transformation matrix. The matrix acts on the left. The following table demonstrates the transformation matrix configuration:
1 |
0 |
0 |
dX |
0 |
1 |
0 |
dY |
0 |
0 |
1 |
dZ |
0 |
0 |
0 |
1 |
Rhino.TransformObjects (arrObjects, arrMatrix [, blnCopy])
arrObjects |
Required. Array. An array of strings identifying the objects to transform. |
arrMatrix |
Required. Array. The transformation matrix (4x4 array of numbers). |
blnCopy |
Optional. Boolean. Copy the objects. If omitted, the objects will not be copied (False). |
Array |
An array of strings identifying the newly transformed objects if successful. |
Null |
If not successful, or on error. |
' Translate (move) objects by (10,10,0)
Dim arrObjects, arrMatrix(3,3)
arrMatrix(0,0) = 1 : arrMatrix(0,1) = 0 : arrMatrix(0,2) = 0 : arrMatrix(0,3) = 10
arrMatrix(1,0) = 0 : arrMatrix(1,1) = 1 : arrMatrix(1,2) = 0 : arrMatrix(1,3) = 10
arrMatrix(2,0) = 0 : arrMatrix(2,1) = 0 : arrMatrix(2,2) = 1 : arrMatrix(2,3) = 0
arrMatrix(3,0) = 0 : arrMatrix(3,1) = 0 : arrMatrix(3,2) = 0 : arrMatrix(3,3) = 1
arrObjects = Rhino.GetObjects("Select objects to translate")
If IsArray(arrObjects) Then
Rhino.TransformObjects arrObjects, arrMatrix
End If