Purpose

The AffineMatrixDecomposition module applies a polar decomposition of a non-singular 4x4-matrix into quaternions (translate, rotate, scale and stretch).

Usage

Connect matrix with Matrix. If automatic update is checked, the decomposed vectors are listed in the Output-section of the panel.

Details

The matrix decomposition follows the paper from Ken Shoemake and Tom Duff: “Matrix Animation and Polar Decomposition”. Their implementation can be viewed and downloaded under the ACM Graphics Gems collection. The code is free to use, but has to be mentioned as Shoemake/Duff code.

A polar decomposition is always unique, but it is not the only possible decomposition.

The state of the output is always displayed in the status-section of the panel.

Interaction

If no auto update is checked, press update to apply decomposition to input matrix.

Windows

Default Panel

../../../Projects/MLAffineMatrix/Modules/mhelp/Images/Screenshots/AffineMatrixDecomposition._default.png

Parameter Fields

Field Index

[]: Trigger Status Code: Enum
Clear: Trigger Status Message: String
Has Valid Output: Bool Stretch: Vector4
Matrix: Matrix Translation: Vector4
On Input Change Behavior: Enum Update: Trigger
Rotation: Vector4  
Scale: Vector4  
Sign: Double  

Visible Fields

Update

name: update, type: Trigger

Initiates update of all output field values.

Clear

name: clear, type: Trigger

Clears all output field values to a clean initial state.

On Input Change Behavior

name: onInputChangeBehavior, type: Enum, default: Clear, deprecated name: shouldUpdateAutomatically,shouldAutoUpdate,autoApply

Declares how the module should react if a value of an input field changes.

Values:

Title Name Deprecated Name
Update Update TRUE
Clear Clear FALSE

Status Code

name: statusCode, type: Enum, persistent: no

Reflects module’s status (successful or failed computations) as one of some predefined enumeration values.

Values:

Title Name
Ok Ok
Invalid input object Invalid input object
Invalid input parameter Invalid input parameter
Internal error Internal error

Status Message

name: statusMessage, type: String, persistent: no

Gives additional, detailed information about status code as human-readable message.

Has Valid Output

name: hasValidOutput, type: Bool, persistent: no

Indicates validity of output field values (success of computation).

[]

name: updateDone, type: Trigger, persistent: no

Notifies that an update was performed (Check status interface fields to identify success or failure).

Matrix

name: inMatrix, type: Matrix, default: 1 0 0 0, 0 1 0 0, 0 0 1 0, 0 0 0 1, deprecated name: InputMatrix

Input matrix, which will be decomposed via polar decomposition into its components (translation, rotation, scaling and stretching).

Translation

name: outTranslation, type: Vector4, persistent: no, deprecated name: Translation

Quaternion vector representing the translation component of the polar decomposition.

Rotation

name: outRotation, type: Vector4, persistent: no, deprecated name: Rotation

Quaternion vector representing the rotation component of the polar decomposition.

Scale

name: outScale, type: Vector4, persistent: no, deprecated name: Scale

Quaternion vector representing the scale component of the polar decomposition.

Stretch

name: outStretch, type: Vector4, persistent: no, deprecated name: Stretch

Quaternion vector representing the stretch component of the polar decomposition.

Sign

name: outSignDeterminant, type: Double, persistent: no

Sign of determinant of quaternion decomposition.