G2_SetBG2Affine

Syntax

#include <nitro/gx/g2.h>

void G2_SetBG2Affine(
    const MtxFx22 * mtx,
    int centerX,
    int centerY,
    int x1,
    int y1
);

Arguments

mtx Pointer to the conversion matrix
centerX X-component of the coordinates of the center of rotation
centerY Y-component of the coordinates of the center of rotation
x1 X-component of coordinate before rotation (horizontal offset)
y1 Y-component of coordinate before rotation (vertical offset)

Return Values

None.

Description

Sets the BG2 affine transformation.

Use the formula below to find the rotation and scaling centered on the points on the screen (center x and center y).

Translation specifies in pixels the offset (x1, y1) of the BG screen with the display screen.

Example:
Rotate/scale BG2 screen centered on a point (center x, center y) using the conversion matrix mtx and 
translate dx to the x-axis direction and dy to the y-axis direction.
G2_SetBG2Affine( mtx, centerX, centerY, dx, dy );

See Also

G2_SetBG3Affine

Revision History

2009/07/10 Revised explanation of affine conversion and added an example.
2004/01/19 Initial version.


CONFIDENTIAL