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

Column major matrices #22

Open
glyh opened this issue Aug 3, 2024 · 2 comments
Open

Column major matrices #22

glyh opened this issue Aug 3, 2024 · 2 comments

Comments

@glyh
Copy link

glyh commented Aug 3, 2024

OpenGL uses column major matrics so in order to combo well with OpenGL I suppose it would be nice to have a column major version of matrices?

@ikskuh
Copy link
Member

ikskuh commented Aug 3, 2024

The matrixes should work out of the box as-is with OpenGL. Did you encounter any problems?

@glyh
Copy link
Author

glyh commented Aug 3, 2024

We're using row major matrices AFAIK, so computation does not work seemlessly with openGL.

For example, there's an old demo of someone using zlm to replcate learnopengl tutorial's lesson on transformation.

Here's the code.

Pay attention to this line:

https://github.com/Flecart/zig-learnopengl/blob/2bd30f3286a99c825023bcec2199dba770b8315a/src/chapter-5/5.1.zig#L195

You see the order of multiplication is incorrect. But exchanging the order yields the wrong result.

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

2 participants