Frees a #CoglMatrix that was previously allocated via a call to cogl_matrix_copy().
Multiplies matrix
by the given frustum perspective matrix.
X position of the left clipping plane where it intersects the near clipping plane
X position of the right clipping plane where it intersects the near clipping plane
Y position of the bottom clipping plane where it intersects the near clipping plane
Y position of the top clipping plane where it intersects the near clipping plane
The distance to the near clipping plane (Must be positive)
The distance to the far clipping plane (Must be positive)
Casts matrix
to a float array which can be directly passed to OpenGL.
Gets the inverse transform of a given matrix and uses it to initialize a new #CoglMatrix.
Initializes matrix
with the contents of array
A linear array of 16 floats (column-major order)
Resets matrix to the identity matrix:
|[ .xx=1; .xy=0; .xz=0; .xw=0; .yx=0; .yy=1; .yz=0; .yw=0; .zx=0; .zy=0; .zz=1; .zw=0; .wx=0; .wy=0; .wz=0; .ww=1;
Resets matrix to the (tx, ty, tz) translation matrix:
|[ .xx=1; .xy=0; .xz=0; .xw=tx; .yx=0; .yy=1; .yz=0; .yw=ty; .zx=0; .zy=0; .zz=1; .zw=tz; .wx=0; .wy=0; .wz=0; .ww=1;
@param tx x coordinate of the translation vector
@param ty y coordinate of the translation vector
@param tz z coordinate of the translation vector
Determines if the given matrix is an identity matrix.
Applies a view transform matrix
that positions the camera at
the coordinate (eye_position_x,
eye_position_y,
eye_position_z)
looking towards an object at the coordinate (object_x,
object_y,
object_z)
. The top of the camera is aligned to the given world up
vector, which is normally simply (0, 1, 0) to map up to the
positive direction of the y axis.
Because there is a lot of missleading documentation online for gluLookAt regarding the up vector we want to try and be a bit clearer here.
The up vector should simply be relative to your world coordinates and does not need to change as you move the eye and object positions. Many online sources may claim that the up vector needs to be perpendicular to the vector between the eye and object position (partly because the man page is somewhat missleading) but that is not necessary for this function.
The X coordinate to look from
The Y coordinate to look from
The Z coordinate to look from
The X coordinate of the object to look at
The Y coordinate of the object to look at
The Z coordinate of the object to look at
The X component of the world's up direction vector
The Y component of the world's up direction vector
The Z component of the world's up direction vector
Multiplies the two supplied matrices together and stores
the resulting matrix inside result
.
a
matrix in-place, so
result
can be equal to a
but can't be equal to b
.
Multiplies matrix
by a parallel projection matrix.
The coordinate for the left clipping plane
The coordinate for the right clipping plane
The coordinate for the bottom clipping plane
The coordinate for the top clipping plane
The
The
Multiplies matrix
by the described perspective matrix
z_far
/ z_near
ratio since that will reduce the effectiveness of depth testing
since there wont be enough precision to identify the depth of
objects near to each other.
Vertical field of view angle in degrees.
The (width over height) aspect ratio for display
The distance to the near clipping plane (Must be positive, and must not be 0)
The distance to the far clipping plane (Must be positive)
Multiplies matrix
with a rotation matrix that applies a rotation
of angle
degrees around the specified 3D vector.
The angle you want to rotate in degrees
X component of your rotation vector
Y component of your rotation vector
Z component of your rotation vector
Multiplies matrix
with a transform matrix that scales along the X,
Y and Z axis.
The X scale factor
The Y scale factor
The Z scale factor
Transforms a point whos position is given and returned as four float components.
The X component of your points position
The Y component of your points position
The Z component of your points position
The W component of your points position
Multiplies matrix
with a transform matrix that translates along
the X, Y and Z axis.
The X translation you want to apply
The Y translation you want to apply
The Z translation you want to apply
Replaces matrix
with its transpose. Ie, every element (i,j) in the
new matrix is taken from element (j,i) in the old matrix.
Compares two matrices to see if they represent the same transformation. Although internally the matrices may have different annotations associated with them and may potentially have a cached inverse matrix these are not considered in the comparison.
A 4x4 transformation matrix
A 4x4 transformation matrix
A CoglMatrix holds a 4x4 transform matrix. This is a single precision, column-major matrix which means it is compatible with what OpenGL expects.
A CoglMatrix 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 CoglMatrix 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