Clutter::Cogl::Matrix(3pm)

Clutter::Cogl::Matrix3pm

A 4x4 transformation matrix

Usage

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

Overview

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().

Methods

array = $matrix->get_array

Converts matrix to an array of 16 floating point values which can be passed to OpenGL.

$matrix->frustum ($left, $right, $bottom, $top, $z_near, $z_far)

•

$left (double)

•

$right (double)

•

$bottom (double)

•

$top (double)

•

$z_near (double)

•

$z_far (double)

matrix = Clutter::Cogl::Matrix->init_identity

matrix = $op1->multiply ($op2)

•

$op2 (matrix)

$matrix->ortho ($left, $right, $bottom, $top, $z_near, $z_far)

•

$left (double)

•

$right (double)

•

$bottom (double)

•

$top (double)

•

$z_near (double)

•

$z_far (double)

$matrix->perspective ($fov_y, $aspect, $z_near, $z_far)

•

$fov_y (double)

•

$aspect (double)

•

$z_near (double)

•

$z_far (double)

$matrix->rotate ($angle, $x, $y, $z)

•

$angle (double)

•

$x (double)

•

$y (double)

•

$z (double)

$matrix->scale ($sx, $sy, $sz)

•

$sx (double)

•

$sy (double)

•

$sz (double)

(x, y, z, w) = $matrix->transform_point (x, y, z, w)

•

$x (double)

•

$y (double)

•

$z (double)

•

$w (double)

$matrix->translate ($x, $y, $z)

•

$x (double)

•

$y (double)

•

$z (double)

From libclutter-perl 1.002-1 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.