Dec 17, 2022 at 11:02pm UTC
i need create a especific array type: Matrix4X4. but is like:
float ProjectionMatrix[4][4];
can i create a type, using typedef or something, for what i need?
something like:
1 2 3
typedef array[4][4] Matrix4X4;
Matrix4X4 Projection;
Projection[0][0] = 100;
ok.. that line is wrong but is for help what i need.
Last edited on Dec 17, 2022 at 11:08pm UTC
Dec 18, 2022 at 12:35am UTC
using Matrix4x4 = float[4][4];
Or
typedef float Matrix4x4[4][4];
Dec 18, 2022 at 11:03pm UTC
There's also Eigen, which already has a bunch of matrix types and linear algebra operations implemented.
Dec 19, 2022 at 8:27am UTC
The 'typedef' and 'using' do not create "new type"; they define an alias -- an another, more convenient name -- for the existing type.
I'd guess that the four by four here is about 3D graphics transformations . There definitely are libraries/frameworks for that too.