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

control zoom in non-blocking visualizer #1443

Closed
MrGoort opened this issue Jan 15, 2020 · 5 comments
Closed

control zoom in non-blocking visualizer #1443

MrGoort opened this issue Jan 15, 2020 · 5 comments
Labels

Comments

@MrGoort
Copy link

MrGoort commented Jan 15, 2020

Hi all,

I have several point clouds of the same environment and each of them have more or less height. Instead of loading everything at the same time, I am loading each cloud at a time, and register it against the previous loaded one and then show the result in a non-blocking visualizer. When I am trying to move the camera to place it in the center of each new point cloud and in a top-view (like birds eye view), I have problems setting the view to keep at the same height, meaning, if the new point cloud has more height than the previous one, the camera zoom shouldn't move. Right now I am trying to do it like this:

Eigen::Vector3d minBound = cloud->GetMinBound();
Eigen::Vector3d maxBound = cloud->GetMaxBound();
open3d::visualization::ViewParameters viewParams;
viewParams.boundingbox_min_ = minBound;
viewParams.boundingbox_max_ = maxBound;
viewParams.lookat_ = (minBound + maxBound) / 2;
viewParams.field_of_view_ = 60.0;
viewParams.zoom_ = 0.7;
viewParams.up_ << 0.0, 1.0, 0.0;
viewParams.front_ << 0.0, 0.0, 1.0;
visualiser.GetViewControl().ConvertFromViewParameters(viewParams);

while the view is moving to keep it to the center of the x,y coords of the new cloud, the zoom keeps changing all the time.
Is there any way of keeping the same Z position in the viewer? Keeping a global variable for it or recomputing it every time, doesn't matter.
I cannot find anything indicating or explaining how to do it.

Thanks for the help

@pablospe
Copy link
Contributor

Perhaps you can modify the code to avoid the max/min in the code (check code in issue #1427):
https://github.com/intel-isl/Open3D/blob/fab6441b763b4964ef898cbb3fae8d10ef98442f/src/Visualization/Visualizer/ViewControl.cpp#L191

Note: I guess it is also related to this issue: #497

@MrGoort
Copy link
Author

MrGoort commented Jan 23, 2020

Hey thanks for the help!.
I don't know if this is the same problem as those linked issues as Z moves around and the zoom works, but it doesn't keep it at the same value.
Anyway, I would like to avoid modifying the source code of the library, unless it is strictly necessary.
Maybe one of the authors have an idea of how to efficiently control the camera and zoom in the viewer.

@pablospe
Copy link
Contributor

pablospe commented Jan 24, 2020

Maybe just trying (in the line mentioned above):
zoom_ = ideal_zoom;
?

@germanros1987
Copy link
Contributor

Hi! In the Open3D team, we take your question very seriously. In order to provide better assistance to our users, we are implementing new policies. Now general questions should be asked in our forum: https://forum.open3d.org

Github issues will remain in use for bug reports and feature requests.

We are looking forward to answering your question in our forum!

Best regards.

@germanros1987
Copy link
Contributor

This should be now possible in the new visualization module. Please, see examples here: https://github.com/intel-isl/Open3D/tree/master/examples/python/gui

@theNded theNded closed this as completed Nov 22, 2021
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

4 participants