Reference for the Mosaic class Graphics::WarpMatrix

Graphics::WarpMatrix
EyeDistance
Assign()
Interpolate()
IsIdentity()
LoadIdentity()
Multiply()
Pop()
Push()
Rotate()
Scale()
Translate()

SEE ALSO

Using the Warp Image view to display a bitmap stretched, scaled and rotated in the 3D space.

Using the Warp Group view to display the image (the appearance) of another GUI component stretched, scaled and rotated in the 3D space.

The class Graphics::WarpMatrix provides the core functionality for all 2D and 3D transformations. With its aim, Views::WarpImage and Views::WarpGroup can be translated, scaled and rotated around the X, Y and Z axis. Moreover, small 3D scenes consisting of several warp views can be defined. This allows you to enrich GUI components with fancy 3D effects. Please note, Embedded Wizard is not a 3D GUI development tool! Its lightweight 3D functionality is limited to the perspectively correct projection of a source image onto a four corners polygon lying in the GUI component. The matrix coefficients describe thus the transformation of the rectangular area of the source image into a four corners polygon.

To define the desired transformation the WarpMatrix class provides following three methods Translate(), Scale() and Rotate(). These can be combined together in order to get more complex transformations. The source image can thus be rotated and then e.g. translated in the 3D space. The order in which these operations are executed is essential. Changing of the order may produce different results.

The methods Push() and Pop() are very useful to store and restore the current state of the matrix on the matrix stack. This is important when 3D scenes are composed of several transformed source images. In this manner one and the same matrix is used for all warp views. To perform the transformation defined in the matrix, pass it to the Warp3D() method provided by the WarpImage and WarpGroup views.

method Graphics::WarpMatrix Assign
(
arg Graphics::WarpMatrix aMatrix
);

The method Assign() copies the coefficients of the given aMatrix into the own coefficients. The method returns 'this' object to the caller.

property float EyeDistance = 0.0;

The property 'EyeDistance' determines the position of the observer. The more away the observer the smaller do appear the objects in the 3D space.

method Graphics::WarpMatrix Interpolate
(
arg Graphics::WarpMatrix aMatrix1,
arg Graphics::WarpMatrix aMatrix2,
arg float aFactor
);

The method Interpolate() calculates the matrix coefficients and the value of EyeDistance as an interpolation between the given source matrices aMatrix1 and aMatrix2. The resulting composition is determined by the parameter aFactor, which can obtain values in the range 0.0 .. 1.0. The value 0.0 is related to the first source matrix. The value 1.0 corresponds to the second source matrix. The results of the interpolation replace the values stored actually in 'this' object. The method returns 'this' object to the caller.

method bool IsIdentity();

The method IsIdentity() returns 'true' if the matrix coeficients in 'this' object don't describe any transformation.

method Graphics::WarpMatrix LoadIdentity();

The method LoadIdentity() resets the coefficients of the matrix. In this manner the matrix is prepared for the following Translate(), Scale() and Rotate() invocations. The method returns 'this' object to the caller.

method Graphics::WarpMatrix Multiply
(
arg Graphics::WarpMatrix aMatrix
);

The method Multiply() multiplies the matrix provided in the parameter aMatrix with 'this' matrix replacing the coeficients stored in 'this' object with the results of the operation. The method returns 'this' object to the caller.

method Graphics::WarpMatrix Pop();

The method Pop() restores the current state of the matrix from an internal stack. This is very useful during the definition of 3D scenes consisting of several source images. The method returns 'this' matrix object to the caller.

method Graphics::WarpMatrix Push();

The method Push() stores the current state of the matrix on an internal stack. This is very useful during the definition of 3D scenes consisting of several source images. The method returns 'this' matrix object to the caller.

method Graphics::WarpMatrix Rotate
(
arg float aAngleX,
arg float aAngleY,
arg float aAngleZ
);

The method Rotate() applies the given angles to the matrix. This corresponds to the rotation of the source image around the X-, Y- and Z-axis. The angles are specified in degrees. The method returns 'this' object to the caller.

method Graphics::WarpMatrix Scale
(
arg float aScaleX,
arg float aScaleY,
arg float aScaleZ
);

The method Scale() applies the given factors to the matrix. This corresponds to the scaling of the source image by the given factors in the X-, Y- and Z-direction. The method returns 'this' object to the caller.

method Graphics::WarpMatrix Translate
(
arg float aDeltaX,
arg float aDeltaY,
arg float aDeltaZ
);

The method Translate() applies the given displacement to the matrix. This corresponds to the translation of the source image by the given values in the X-, Y- and Z-direction. The method returns 'this' object to the caller.