Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using mat4x4_scale as a MODEL uniform #19

Open
ghost opened this issue Jun 12, 2015 · 2 comments
Open

using mat4x4_scale as a MODEL uniform #19

ghost opened this issue Jun 12, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 12, 2015

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.

@datenwolf
Copy link
Owner

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);

@datenwolf
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant