Clutter::Cogl::Matrix(3pm)
NAME
Clutter::Cogl::Matrix - A 4x4 transformation matrix
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().
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)
- o $left (double)
- o $right (double)
- o $bottom (double)
- o $top (double)
- o $z_near (double)
- o $z_far (double)
- matrix = Clutter::Cogl::Matrix->init_identity matrix = $op1->multiply ($op2)
- o $op2 (matrix)
- $matrix->ortho ($left, $right, $bottom, $top, $z_near, $z_far)
- o $left (double)
- o $right (double)
- o $bottom (double)
- o $top (double)
- o $z_near (double)
- o $z_far (double)
- $matrix->perspective ($fov_y, $aspect, $z_near, $z_far)
- o $fov_y (double)
- o $aspect (double)
- o $z_near (double)
- o $z_far (double)
- $matrix->rotate ($angle, $x, $y, $z)
- o $angle (double)
- o $x (double)
- o $y (double)
- o $z (double)
- $matrix->scale ($sx, $sy, $sz)
- o $sx (double)
- o $sy (double)
- o $sz (double)
- (x, y, z, w) = $matrix->transform_point (x, y, z, w)
- o $x (double)
- o $y (double)
- o $z (double)
- o $w (double)
- $matrix->translate ($x, $y, $z)
- o $x (double)
- o $y (double)
- o $z (double)
SEE ALSO
Clutter
COPYRIGHT
Copyright (C) 2006, 2007, 2008 OpenedHand Ltd
Copyright (C) 2009 Intel Corporation
This module is free software; you can redistribute it and/or modify it
under the terms of either:
o the GNU Lesser General Public Library version 2.1; or
o the Artistic License, version 2.0.
- See Clutter for the full copyright notice.