GSDP:GAM100/CProcessing/Mat3

From Inside
Jump to: navigation, search

Mat3

Description

A Mat3 (3D matrix type) is a structure that can hold nine float values. This is used for linear algebra and transformation, but can be used for any purpose that requires nine float values. There are a series of operations that can be done using a 3D matrix that are also provided.

Example

void update() 
{
    // create a transform and set it to initialized values
    Mat3 transform = mat3();

    // make the matrix a translation transform by (100, 100)
    transform = mat3_translate( (Vec2) { 100, 100 } );

    // create a vec2 position
    Vec2 position;
    position.x = 100;
    position.y = 100;

    // apply that matrix to the point and store it in the position
    position = mat3_mult_vec2(transform, position);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>