I’m reading OpenGL Programming Guide, Ninth Edition.
I’m in trouble with this:
#version 420 core
uniform mat4 model_matrix;
…
layout (location = 0) in vec4 position;
…
void main(void)
{
vec4 pos = (model_matrix * (position * vec4(1.0, 1.0, 1.0, 1.0)));
…
};
So, what’s the point in multiplying "position" times vec4(1.0, 1.0, 1.0, 1.0)? The result will be "position" with or without vec4(1.0, 1.0, 1.0, 1.0).
vec4*vec4
is piecewise multiplication so its just scaling. Yes its redundant but maybe it will be latter on (in the tutorial or whatever) used for scaling ... – Spektre