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

Functions not the same across mat4, mat3, mat2 #460

Open
FrostKiwi opened this issue Oct 18, 2023 · 0 comments
Open

Functions not the same across mat4, mat3, mat2 #460

FrostKiwi opened this issue Oct 18, 2023 · 0 comments

Comments

@FrostKiwi
Copy link

I'm a huge fan of this library and it was an important part in my recent project (https://github.com/FrostKiwi/Mirrorball), specifically credited gl-matrix in the credits^^
I migrated to this project when porting my code to WebApps, away from https://github.com/recp/cglm

One of the things I came across is mat4 having features, that are missing in the mat3 implementation, leading to some weird workarounds being needed like here of rotating a mat4, then stripping it down to a mat3 for use in a shader.
So it would be great if for the 4.0 release, we could standardize function behavior and feature set across all dimensions.

One of these things is rotation. mat4 has rotate(), where you can specify an axis:

export function rotate(out, a, rad, axis) {

as well as extra helpers for rotations around the standard axes:
export function rotateX(out, a, rad) {

export function rotateY(out, a, rad) {

export function rotateZ(out, a, rad) {

mat3 does have rotate() function, but it has no input for which axis it should be rotated around. It just assumes the Z-Axis and there are also no helpers for the other axes.

export function rotate(out, a, rad) {

It's one of the things that are different across dimensions in gl-matrix. This is my one of my feature requests for 4.0. Coming from cglm I also miss some functions for simple cases like here: https://cglm.readthedocs.io/en/latest/affine-mat.html, but that's outside the scope of this issue.

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