I have this toy example where i want to change the default view while calling the visualizer.run(), for example i want to change the default values of zoom , rotate and scale of the scene in the visualizer. Any help will be appreciated
import sys
import numpy as np
import open3d as o3d
# cloud = o3d.geometry.PointCloud()
ply_point_cloud = o3d.data.PLYPointCloud()
pcd = o3d.io.read_point_cloud(ply_point_cloud.path)
visualizer = o3d.visualization.Visualizer()
visualizer.create_window()
visualizer.add_geometry(pcd)
view_ctl = visualizer.get_view_control()
# view_ctl= view_ctl.convert_to_pinhole_camera_parameters() # noqa: E501
view_ctl.scale(0)
visualizer.update_renderer()
visualizer.run()
The code is fine (tested and results below) however, I am pretty sure you are using version 0.17.0. Move to version
0.18.0or more recent developer releases where this bug has been fixed. Install from here.P.S. Root issue is due to
get_view_controlreturning a copy ofViewControlofVisualizerand hence any changes to it does not affect theVisualizer.This produces a left shifted image instead of keeping pointcloud in center -