Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members Related Pages
Contructing the effect transformation matrix
The Demopaja system supports plugin effects to be transformed using translation rotation and scale. Additionally rotation and scale can have a pivot point. The plugin effect does not have to support none of these transformations. It is though adviced to support at least position and scale transformation.
The rotation matrix is constructed in following order using the Matrix2C class:
Where P is pivot patrix, R is rotation matrix, S is scale matrix, and T is translation matrix.
First the effect is offset to the pivot position then it is rotated, then scaled and finally translated to it's final position. The rotation and scale are in different order than usually expected. This avoids extra calculation which should be handled if the effect were scaled after rotation. It will also ease the editing process, since effects can be easier transformed in groups.
The Demopaja system gets the parameters which affects the transformation via the get_default_param() method in the EffectI interface. It is important to implement the method correctly. The parameters can be inside any gizmo, the get_default_param() method just returns the requested parameter.
- See also:
-
Composition::EffectI::get_default_param()
DEFAULT_PARAM_POSITION Position parameter has to be type ParamVector2C and have style: PARAM_STYLE_ABS_POSITION.
DEFAULT_PARAM_PIVOT Pivot parameter has to be type ParamVector2C and have styles: PARAM_STYLE_REL_POSITION and PARAM_STYLE_WORLD_SPACE. The system handles pivot parameter a bit different than other parameters which affect the transformation. When a pivot is moved, also the position of the effect changes. If the position parameter is animated the change will also affect the animation. This is done to compensate the pivot change.
DEFAULT_PARAM_ROTATION Rotation parameter has to be type ParamFloatC. It is adviced to also set the PARAM_STYLE_ANGLE style to indicate that the parameter is angle in the user interface.
DEFAULT_PARAM_SCALE Scale parameter has to be type ParamVector2C. It is adviced to also set the PARAM_STYLE_PERCENT style to indicate that the parameter is show as percent in the user interface.
- See also:
-
Composition::EffectI , PajaTypes::Matrix2C
Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions