-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unprojection function in the ViewControl #2852
Conversation
This function can be used to obtain a ray to perform raycasting queries on the visualizer. Also, since this operation is const, I added a const overload to obtain the ViewControl from the visualizer.
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
Previously, I ignored a format error, as it seemed to me that my code was coherent with the other code, but the PR failed, so I now I applied the style fix anyway.
Hi,
but then I see (line 11028) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 4 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @PieroV)
Hello! What do you need me to do? Squash and rebase? |
This function can be used to obtain a ray to perform raycasting queries on the visualizer. Co-authored-by: Rene Sepulveda <errissa@gmail.com>
Undo change introduced in PR #2852
py::return_value_policy::reference_internal) | ||
.def( | ||
"get_view_control", | ||
[](Visualizer &vis) { return vis.GetViewControl(); }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the purpose of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes were reverted in this PR:
https://github.com/isl-org/Open3D/pull/6116/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I saw the comment, but then somehow forgot to reply.
The purpose of that change was to make that object available to Python (it wasn't when I wrote this PR 2 years and a half ago, IIRC).
Otherwise, you could run this code only from C++.
IIRC the lambda was used to avoid using a cast to tell the version of the function pybind should have exposed.
The PR fixes the bindings bug, but it also breaks C++ const correctness, which isn't great for when you want to use it from C++.
Hi!
I added a function to unproject 2D points to obtain a ray from the camera eye containing the 2D point.
It is useful to perform raycasting queries with clicks on the visualizer.
Also, since this operation is const, I added a const overload to obtain the ViewControl from the visualizer.
The function is aware that the camera may be orthogonal rather than perspective.
For these cases, the origin is in a plane that has look_at - eye_ as normal, and in which eye_ lies.
However, because of the overload, I had to modify the python bindings: I added a lambda instead of a cast, as from what I understand that is what you usually do in these cases. It compiled, but I could not create the pip package, so I could not test that everything still worked in Python.
This change is