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

Fix bug in lookAt and lookAlong #26

Closed
httpdigest opened this issue Jun 26, 2015 · 1 comment
Closed

Fix bug in lookAt and lookAlong #26

httpdigest opened this issue Jun 26, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@httpdigest
Copy link
Member

There is a very severe bug in all lookAt and lookAlong (including their set* variants) methods in Matrix4 and Matrix3, which causes the x-column of the resulting matrix to not be a unit vector, and thus the whole 3x3 matrix to not be an orthonormal basis, which it MUST be.

@httpdigest httpdigest added the bug label Jun 26, 2015
@httpdigest httpdigest added this to the 1.4.0 release milestone Jun 26, 2015
@httpdigest httpdigest self-assigned this Jun 26, 2015
httpdigest added a commit that referenced this issue Jun 26, 2015
The cause was that the computed 'right' vector needed to be normalized,
too, because dir and up would not be linearly independent at this point.
This was a pain to track down, but is fixed now!
@httpdigest
Copy link
Member Author

The cause was that the computed 'right' vector needed to be normalized, too, because dir and up would not be perpendicular at this point (we would compute a perpendicular up vector after that).
The effect was that the more the parameter vectors 'up' and 'center - eye' would align (their dot-product becoming greater), the more the x-coordinates would get scaled down towards zero in a vector transformed by the resulting matrix...
This was a pain to track down, but is fixed now!

httpdigest added a commit that referenced this issue Jun 26, 2015
We will recompute it anyway with 'right x dir'
httpdigest added a commit that referenced this issue Jun 26, 2015
Also fix Quaternionf.lookRotate (same issue as #26)
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

1 participant