Purpose

The AffineMatrixComposition module combines quaternion vectors for translation, rotation, scale and stretch to a 4x4 Matrix.

Usage

Connect vectors for translation, rotation, scale and stretch with the according input fields and apply update.

Details

The matrix composition 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.

There are some input restrictions. Translation and scale vectors always have 1.0 as fourth component. If not applicable, an error occurs. Scaling always leads to valid output vectors. If a scale factor causes a vector to be invalid, an appropriate error message is shown.

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 composition of input vectors.

Windows

Default Panel

../../../Projects/MLAffineMatrix/Modules/mhelp/Images/Screenshots/AffineMatrixComposition._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

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).

Translation

name: inTranslation, type: Vector4, default: 0 0 0 1

Quaternion vector representing the translation component.

Rotation

name: inRotation, type: Vector4, default: 0 0 0 1

Quaternion vector representing the rotation component.

Scale

name: inScale, type: Vector4, default: 1 1 1 1

Quaternion vector representing the scale component.

Stretch

name: inStretch, type: Vector4, default: 0 0 0 1

Quaternion vector representing the stretch component.

Sign

name: inSignDeterminant, type: Double, default: 1

Sign of determinant of polar decomposition matrix.

Matrix

name: outMatrix, type: Matrix, persistent: no

Output matrix, which will be composed from polar vectors for translation, rotation, scaling and stretching.