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

Matrix3x3 to Quaternion Conversion #157

Closed
GreenLightning opened this issue Jul 16, 2020 · 2 comments
Closed

Matrix3x3 to Quaternion Conversion #157

GreenLightning opened this issue Jul 16, 2020 · 2 comments
Assignees
Labels

Comments

@GreenLightning
Copy link

Hi,

thanks for making a great library!

I noticed some strange rotation in the output from the debug renderer when setting the transform of a body using a Matrix3x3. The problem went away when converting to a quaternion using GLM, so I believe the problem is in the Matrix3x3 to Quaternion conversion. Here is some example code:

Matrix3x3 original(0.001743,-0.968608,0.248589,-0.614229,-0.197205,-0.764090,0.789126,-0.151359,-0.595290);
Matrix3x3 converted = Quaternion(original).getMatrix();
std::cout << original.to_string() << std::endl;
std::cout << converted.to_string() << std::endl;

Output:

Matrix3x3(0.001743,-0.968608,0.248589,-0.614229,-0.197205,-0.764090,0.789126,-0.151359,-0.595290)
Matrix3x3(0.124709,-0.992193,-0.000000,-0.784941,-0.098659,-0.611665,0.606890,0.076281,-0.791117)
@DanielChappuis
Copy link
Owner

Hello. Thanks a lot for taking the time to report this issue.

I have made a fix with this commit in the master branch.

Could you pull this change and let me know if the issue is also fixed on your side ?

@DanielChappuis DanielChappuis self-assigned this Jul 18, 2020
@GreenLightning
Copy link
Author

Yes, it is fixed now. Thanks!

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

2 participants