Skip to content

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

@FrostKiwi

Description

@FrostKiwi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions