Why in GLSL language doing this:
// position = vec2;
// trans = mat4;
gl_Position = trans * vec4(position, 0.0, 1.0);
is different from:
gl_Position = vec4(position, 0.0, 1.0) * trans;
Why in GLSL language doing this:
// position = vec2;
// trans = mat4;
gl_Position = trans * vec4(position, 0.0, 1.0);
is different from:
gl_Position = vec4(position, 0.0, 1.0) * trans;
Because maths get in the way
[QUOTE=JohnnyKPL;1266062]Why in GLSL language doing this:
// position = vec2;
// trans = mat4;
gl_Position = trans * vec4(position, 0.0, 1.0);
is different from:
gl_Position = vec4(position, 0.0, 1.0) * trans;[/QUOTE]
This is quit basic math algorithm. the first is correct.
vec4 needs 4 elments, but position has only two, thus, you have to add two, 0 and 1. you can also make them 3,6; 2,9 etc. generally the last one makes one.
Because multiplication with matrices is not commutative. Do internet research on commutativity and matrices and you may learn more.