linmath.h
linmath.h copied to clipboard
using mat4x4_scale as a MODEL uniform
can there be a way to use mat4x4_scale to build a scale matrix with the w-component set to 1? that way we can just send it on up to the vertex shader as our scale matrix.
Well, not mat4x4_scale itself, because that would change its semantics. For a quick ad-hoc solution I suggest using mat4x4_scale_aniso (which keeps the w column as is) with the three scaling factors being equal. E.g.
mat4x4 M;
mat4x4_identity(M);
mat4x4_scale_aniso(M, M, s, s, s);
mat…_scale (and vec…_scale for that matter) are defined in terms of multiplication with a scalar value and not so much a scaling in the geometrical sense, although for vectors there's no difference.