Handle Transform Matrix by ITransformer
ITransformer contains a transform matrix and a inverse transform matrix. The matrix is 4x4 column-major matrix, which describe the orientation or movement between 3D coordinates.
Several common used interface and class are implemented from ITransformer. The inheritance is shown:
IStaticTransformer is transformer with constant matrix. NoTransform, StaticTranslation and StaticRotation contains transform matrix of identity, translate and rotate respectively. StaticFreeform contains a arbitrary constant transform matrix.
The transform matrix of StaticTranslation is:
The transform matrix of StaticRotation and DynamicRotation is:
Where Pivot is the position of the rotation axis.
Tip
Pivot is a point. However, rotation axis is a line. It means that it causes the same matrix no matter how the pivot is moving along the axis.
IDynamicTransformer is transformer with inconstant transform matrix. IDynamicRegular has a property Step, implied that the transform matrix is one parameter driven. GetSteps(IDynamicRegular[]) and SetSteps(IDynamicRegular[], double[]) provide easy handle of an array of IDynamicRegular objects.
The transform matrix of DynamicTranslation is:
Note
In convention, Trans should be normalized.