You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Manoylov Andriy eb8d3c5f80 add ukrainian translation 10 months ago
..
README-ua.md add ukrainian translation 10 months ago
README-vi.md Translate the glossary section 4 years ago
README.md folder structure for glossary 8 years ago

README.md

Mat2

2x2 floating point matrix

Declaration

mat2 aMat2 = mat2(1.0, 0.0,  // 1. column
                  0.0, 1.0); // 2. column
mat2 bMat2 = mat2(1.0);
mat2 cMat2 = mat2(aVec2, bVec2);
mat2 dMat2 = mat2(aVec3, aFloat);

Description

mat2 data type is compose for a 2x2 matrix of floating point. As you can see above, can be initialize in different ways:

  • Providing a value for each component column by column.

  • Providing one value that is used for the components on the main diagonal.

  • Providing a combination of vectors and scalars.

In the same way data can be accessed component-wise or column by column:

mat2 aMat2;
aMat2[1][1] = 1.0;
float aFloat = aMat2[1][1];

aMat2[0] = vec2(1.0);
vec2 aVec2 = aMat2[0];

See Also

mat3, mat4, matrixCompMult()