CONTEXT
I'm trying to visualize 3d point cloud from disparity map. It works perfectly with one map.
ISSUE
I want to update what's in window. When I call run() method new thread is opened and I cannot do anything till the window will be closed. I'd like to clear what's in window and display new cloud without closing the window, so it would be something like animation.
CODE
I've created Visualizer object and I do everything on that.
    vis = open3d.visualization.Visualizer()
    vis.create_window()
    cloud = open3d.io.read_point_cloud(out_fn) # out_fn is file name
    vis.add_geometry(cloud)
    vis.run()
The class open3d.visualization.Visualizer has .update_geometry() and .remove_geometry() function you can use to achieve that. Another way around you can try is using open3d.visualization.VisualizerWithKeyCallback class.
vis = o3d.visualization.VisualizerWithKeyCallback()
cloud = open3d.io.read_point_cloud(out_fn)
vis.create_window()
vis.register_key_callback(key, your_update_function)
vis.add_geometry(cloud)
vis.run()
def your_update_function():
    #Your update routine
    vis.update_geometry(cloud)
    vis.update_renderer()
    vis.poll_events()
    vis.run()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With