Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix Orthographic Picking #29

Merged
merged 2 commits into from
Feb 15, 2024
Merged

fix Orthographic Picking #29

merged 2 commits into from
Feb 15, 2024

Conversation

paul2t
Copy link
Contributor

@paul2t paul2t commented Jan 11, 2024

There is an issue with the 3d picking with an orthographic 3d camera.
It was working in top view, which is why it was working in the case of a 2d camera.
This change seems to be fixing the picking for any 3d orthographic camera.
This is using : https://stackoverflow.com/questions/7692988/opengl-math-projecting-screen-space-to-world-space-coords
I'm not sure how this can be factorized with the Perspective screen2ray.

@asny
Copy link
Owner

asny commented Feb 15, 2024

Thanks for the contribution 🙏 I've changed it so it's not calculating screen2ray two times which might affect performance. What do you think? And is it still working in your case?

@paul2t
Copy link
Contributor Author

paul2t commented Feb 15, 2024

I knew there was something to be done to avoid that, but didn't take the time to figure it out.
The changes look great and simpler.
It's still working in my case.
Thanks.

@asny
Copy link
Owner

asny commented Feb 15, 2024

Perfect, thanks for testing 👍

@asny asny merged commit 268236a into asny:main Feb 15, 2024
4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants