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

quat.setAxes initialize a mat3 in a (probably) wrong way #436

Open
signorpipo opened this issue Jul 29, 2021 · 1 comment
Open

quat.setAxes initialize a mat3 in a (probably) wrong way #436

signorpipo opened this issue Jul 29, 2021 · 1 comment

Comments

@signorpipo
Copy link

I was looking at the code for the method setAxes (https://glmatrix.net/docs/quat.js.html#line716) and it initialize the mat3 as if the axes are not specified all together (so right would be the first 3 numbers of the matrix).
Seeing how mat4 handles them, it seems to me that right is made by [0] [1] and [2], and not [0] [3] and [6]

I'm not sure of this of course, but otherwise the way mat4 is handled is weird, having instead the translation in the last 4 digits

@TristanM42
Copy link

Hello, i had same issue, i can't understand why my oriention is always wrong, i tried different orders for my vectors in hope to find the correct orientation for given vectors but i never found a way. I hope someone will make it clear.

I found another way to do same but without setAxes. From local to global = from no orientation to new orientation : we can use vectors without "substracting" previous orientation (since it's identity rotation) :

const matrix = mat3.fromValues(...xAxisNormalized, ...axisProximalToDistalNormalized, ...axisNormalNormalized); const newOrientation = quat.create(); quat.fromMat3(newOrientation, matrix);

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