Open echeng-git opened 1 year ago
References to the actual rotations and trasnlations carried out with OpenGL can be found in labelCloud/model/point_cloud.py
, in the set_gl_background()
method, which is constantly updated.
Note that the glTranslate()
and glRotate()
methods have to do with rotating the entire point cloud in this case. The rotation center can be changed by changing the value of pcd_center
in the set_gl_background()
method.
We could add a widget where we doubleclick on the screen to set the rotation center in a similar way to CloudCompare, by changing pcd_center
.
In order to zoom in and out with the scroll wheel from the zoom_into()
method, trans_z
of the currently displayed point cloud is changed by the set_trans_z()
method.
Here is a code snippet of the zoom_into
method of pcd_manager.py:
def zoom_into(self, distance) -> None:
assert self.pointcloud is not None
zoom_distance = distance * PointCloudManger.ZOOM_FACTOR
self.pointcloud.set_trans_z(self.pointcloud.trans_z + zoom_distance)
When trans_z
of the current point cloud is set, it is automatically updated in the set_gl_background
method of the currently selected point cloud (point_cloud.py).
As of now, the camera options only really work for smaller point clouds (such as the one in the example), since the center of camera rotation appears to be fixed. The standard zoom factor is also constant as well.
Implement a variable center of rotation, and variable zoom factor similar to that of CloudCompare.
References to the zoom factor (originally defined in the configuration as a constant value) can be found in
labelCloud/control/Controller.py
, in themouse_scroll_event()
method and subsequently thezoom_into()
method inlabelCloud/control/pcd_manager.py
.References to camera rotation can be in the
mouse_move_event()
in Controller.py, and subsequently pcd_manager.py as mentioned above.