Hi

mat4 is a 4*4 matrix. can I initialize this matrix with 12 values?As an example:

vec4 a(0,0,0,0);

vec4 b(1,1,1,1);

vec4 c(2,2,2,2);

mat4 d(a, b, c );

-Ehsan-

Hi

mat4 is a 4*4 matrix. can I initialize this matrix with 12 values?As an example:

vec4 a(0,0,0,0);

vec4 b(1,1,1,1);

vec4 c(2,2,2,2);

mat4 d(a, b, c );

-Ehsan-

no.

the spec states that there must always be enough components to initialize a whole vector or matrix, so in your case you need 16 values.

I guess this law is not correct for vectors. Also we can use from one number to initialize the matrix. As an example the following command sets all the diagonal values to 1 and sets other values to 0:

mat3 matrix(1);

( But I think that if we use from more than one value to initialize matices, we should initialize all the values ).

-Ehsan-

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.