Emmanuele Bassi > Clutter > xs/CoglMatrix.xs

Download:
Clutter-1.002.tar.gz

Annotate this POD

CPAN RT

New  2
Open  2
View Bugs
Report a bug
Source  

SYNOPSIS ^

    my $matrix = Clutter::Cogl::Matrix->init_identity();
    $matrix->rotate(90.0, 0, 0, 0);
    $matrix->scale(2.0, 2.0, 0);

DESCRIPTION ^

A Clutter::Cogl::Matrix holds a 4x4 transform matrix. This is a single precision, column-major matrix which means it is compatible with what OpenGL expects.

A lMatrix can represent transforms such as, rotations, scaling, translation, sheering, and linear projections. You can combine these transforms by multiplying multiple matrices in the order you want them applied.

The transformation of a vertex (x, y, z, w) by a Clutter::Cogl::Matrix is given by:

    x_new = xx * x + xy * y + xz * z + xw * w
    y_new = yx * x + yy * y + yz * z + yw * w
    z_new = zx * x + zy * y + zz * z + zw * w
    w_new = wx * x + wy * y + wz * z + ww * w

Where w is normally 1

Note: You must consider the members of the Clutter::Cogl::Matrix structure read only, and all matrix modifications must be done via the Matrix API. This allows Cogl to annotate the matrices internally. Violation of this will give undefined results. If you need to initialize a matrix with a constant other than the identity matrix you can use cogl_matrix_init_from_array().