XformRotation

Returns a rotation transformation matrix. The XformRotation provides several ways to compute a rotation transformation.  A positive rotation angle indicates a counter-clockwise (right hand rule) rotation about the axis of rotation.

Syntax

Rhino.XformRotation (arrPlane1, arrPlane2)

Rhino.XformRotation (dblAngle, arrAxis, arrPoint)

Rhino.XformRotation (arrStartDir, arrEndDir, arrPoint)

Rhino.XformRotation (arrX0, arrY0, arrZ0, arrX1, arrY1, arrZ1)

Parameters

arrPlane1

Required.  Array (Plane).  The starting plane.

arrPlane2

Required.  Array (Plane).  The ending plane.

dblAngle

Required.  Number.  The rotation angle in degrees.

arrAxis

Required.  Array (3-D Vector).  The rotation axis.

arrStartDir

Required.  Array (3-D Vector).  The starting direction.

arrEndDir

Required.  Array (3-D Vector).  The ending direction.

arrPoint

Required.  Array (3-D Point).  The rotation center point.

arrX0

Required.  Array (3-D Vector).  The initial frame X

arrY0

Required.  Array (3-D Vector).  The initial frame Y.

arrZ0

Required.  Array (3-D Vector).  The initial frame Z.

arrX1

Required.  Array (3-D Vector).  The final frame X.

arrY1

Required.  Array (3-D Vector).  The final frame Y.

arrZ1

Required.  Array (3-D Vector).  The final frame Z.

Returns

Array

The 4x4 transformation matrix.

Null

On error.

Notes

Option 1 creates a rotation transformation that maps arrPlane1 to arrPlane1. The planes should be right hand orthonormal planes. This transformations is not the same as the change of basis transformations. For more information, see XformChangeBasis.

Option 2 calculate the minimal transformation that rotates arrStartDir to arrEndDir while fixing arrPoint.

Option 4 required that frames should be right hand orthonormal frames. The resulting rotation fixes the origin (0,0,0), maps initial X to final X, initial Y to final Y, and initial Z to final Z.

Example

arrObjects = Rhino.GetObjects("Select objects to rotate")

If IsArray(arrObjects) Then

  arrCPlane = Rhino.ViewCPlane

  arrXform = Rhino.XformRotation(45.0, arrCPlane(3), arrCPlane(0))

  Rhino.TransformObjects arrObjects, arrXform, True

End If

Also See

XformMirror

XformPlanarProjection

XformScale

XformShear

XformTranslation