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

Creating a Matrix4 from Quaternions #530

Open
Perseus opened this issue May 1, 2021 · 2 comments
Open

Creating a Matrix4 from Quaternions #530

Perseus opened this issue May 1, 2021 · 2 comments
Labels

Comments

@Perseus
Copy link

Perseus commented May 1, 2021

I've been working with cgmath, trying to use the Matrix4 and Quaternion structs for some animation related graphics stuff.

I ran into something which required me to create a 4x4 Matrix from a Quaternion. On doing this using Matrix4::from(quaternion), the value of the matrix seemed to be row-major. Is this something that is intended or am I mistaken here? I've only recently started working with quaternions, so there might be a gap in my knowledge in this area.

Since the resultant matrix seemed to be row-major, multiplication with other matrices would give the wrong result. I looked at the source for Matrix::from(<Quaternion>) and Matrix::from_translation<Vector3>, they both seemed to be returning row-major matrices

Would love some help/clarification here. Thanks!

@kvark kvark added the question label Jun 9, 2021
@kvark
Copy link
Collaborator

kvark commented Jun 9, 2021

We used quaternions quite a bit, and matrix multiplication from quaternions works fine.
I don't have the bandwidth to go into details right now, but perhaps if you write down the details somebody can find it and help?

@aloucks
Copy link
Collaborator

aloucks commented Jun 14, 2021

I recall getting hung up on this (or something similar) before. There seemed to be an inconsistency with row/column major as well as the handedness. I think we've resolved most of the handedness issues, but I'm not certain about row vs column major.

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

No branches or pull requests

3 participants