Use the open3d can’t show the second point cloud with o3d.visualization.VisualizerWithEditing().
python version = 3.8.19
open3d == 0.18.0
numpy == 1.24.4
WLS = 2.0
This is my test file:
import open3d as o3d
import numpy as np
# create point cloud
pcd1 = o3d.geometry.PointCloud()
pcd1.points = o3d.utility.Vector3dVector(np.random.random((100, 3)))
pcd1.paint_uniform_color([1, 0, 0])
pcd2 = o3d.geometry.PointCloud()
pcd2.points = o3d.utility.Vector3dVector(np.random.random((100, 3)))
pcd2.paint_uniform_color([0, 1, 0])
# create window
vis = o3d.visualization.VisualizerWithEditing()
vis.create_window()
# add point cloud data
vis.add_geometry(pcd1, reset_bounding_box=True)
vis.add_geometry(pcd2, reset_bounding_box=False)
ctr = vis.get_view_control()
ctr.set_zoom(0.8)
ctr.rotate(10.0, 0.0)
vis.run()
vis.destroy_window()
picked_points = vis.get_picked_points()
Current result:
enter image description here
I wanted to be able to display two point clouds in a window at the same time, and to be able to select points with the mouse and print coordinates, but after adding the first geometry, the second one couldn’t be displayed.
Desired result:
enter image description here
If open3d actually can’t do this, please tell me how to deal with this with some other graphic framework can solve it. Thanks a lot.
Clyde Tony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.