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

Document that Matrix4::look_at_rh and Matrix4::look_at_lh can output NaN values #504

Open
est31 opened this issue Dec 15, 2018 · 3 comments
Labels
documentation Issues about the rustdoc-generated documentation enhancement good first issue Good first issue for newcomers. P-medium Medium priority

Comments

@est31
Copy link
Contributor

est31 commented Dec 15, 2018

If your looking vector is too close to being parallel to the axis you are passing to Matrix4::look_at_rh, the return value can contain NaN values. This apparently seems to be expected behaviour. However it's a bit surprising if you don't know about this. It should be documented IMO.

@est31
Copy link
Contributor Author

est31 commented Dec 15, 2018

It is documented here: https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml

The UP vector must not be parallel to the line of sight from the eye point to the reference point.

@est31
Copy link
Contributor Author

est31 commented Dec 15, 2018

Also maybe some way of doing this computation in a checked way would be nice, so that you can adjust the vectors. Right now there is a lot of guesswork involved :).

@sebcrozet
Copy link
Member

sebcrozet commented Dec 16, 2018

I agree this should be documented.
We could add methods like try_look_at_rh that takes an epsilon and return an Option if some norm end up being close to zero.

@sebcrozet sebcrozet added enhancement good first issue Good first issue for newcomers. P-medium Medium priority documentation Issues about the rustdoc-generated documentation labels Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues about the rustdoc-generated documentation enhancement good first issue Good first issue for newcomers. P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

2 participants