matrix

matrix — Matrix manipulation and calculation

Synopsis




gboolean    g3d_matrix_identity             (gfloat *matrix);
gboolean    g3d_matrix_multiply             (gfloat *m1,
                                             gfloat *m2,
                                             gfloat *rm);
gboolean    g3d_matrix_translate            (gfloat x,
                                             gfloat y,
                                             gfloat z,
                                             gfloat *rm);
gboolean    g3d_matrix_rotate               (gfloat angle,
                                             gfloat ax,
                                             gfloat ay,
                                             gfloat az,
                                             gfloat *rm);
gboolean    g3d_matrix_rotate_xyz           (gfloat rx,
                                             gfloat ry,
                                             gfloat rz,
                                             gfloat *rm);
gboolean    g3d_matrix_scale                (gfloat x,
                                             gfloat y,
                                             gfloat z,
                                             gfloat *rm);
gboolean    g3d_matrix_transpose            (gfloat *matrix);
gboolean    g3d_matrix_dump                 (gfloat *matrix);

Description

Details

g3d_matrix_identity ()

gboolean    g3d_matrix_identity             (gfloat *matrix);

Sets the given matrix to the identity matrix.

matrix : 4x4 matrix (float[16])
Returns : TRUE on success, FALSE else

g3d_matrix_multiply ()

gboolean    g3d_matrix_multiply             (gfloat *m1,
                                             gfloat *m2,
                                             gfloat *rm);

Multiplies the matrixes.

m1 : first matrix
m2 : second matrix
rm : resulting matrix
Returns : TRUE on success, FALSE else

g3d_matrix_translate ()

gboolean    g3d_matrix_translate            (gfloat x,
                                             gfloat y,
                                             gfloat z,
                                             gfloat *rm);

Adds a translation to the the matrix.

x : x translation
y : y translation
z : z translation
rm : resulting matrix
Returns : TRUE on success, FALSE else

g3d_matrix_rotate ()

gboolean    g3d_matrix_rotate               (gfloat angle,
                                             gfloat ax,
                                             gfloat ay,
                                             gfloat az,
                                             gfloat *rm);

Adds a rotation to the matrix.

angle : rotation angle
ax : x component of rotation axis
ay : y component of rotation axis
az : z component of rotation axis
rm : resulting matrix
Returns : TRUE on success, FALSE else

g3d_matrix_rotate_xyz ()

gboolean    g3d_matrix_rotate_xyz           (gfloat rx,
                                             gfloat ry,
                                             gfloat rz,
                                             gfloat *rm);

Adds a rotation around the 3 coordinate system axes to the matrix.

rx : rotation around x axis
ry : rotation around y axis
rz : rotation around z axis
rm : resulting matrix
Returns : TRUE on success, FALSE else

g3d_matrix_scale ()

gboolean    g3d_matrix_scale                (gfloat x,
                                             gfloat y,
                                             gfloat z,
                                             gfloat *rm);

Adds a scaling to the matrix.

x : x factor
y : y factor
z : z factor
rm : resulting matrix
Returns : TRUE on success, FALSE else

g3d_matrix_transpose ()

gboolean    g3d_matrix_transpose            (gfloat *matrix);

Transposes the matrix.

matrix : the matrix
Returns : TRUE on success, FALSE else

g3d_matrix_dump ()

gboolean    g3d_matrix_dump                 (gfloat *matrix);

If debugging is enabled, this function dump the matrix to stderr.

matrix : the matrix
Returns : TRUE if matrix is dumped, FALSE else