Hi! I’m working with PyVista. My ability to zoom in seems limited. The zoom stops at a certain zoom point, and I can’t zoom in any further. I’ve tried to attach a video, but it won’t let me because I’m a new user. Are there set limits on the max zoom? Are these configurable?
@banesullivan - mentioned that I should flag the problem here.
This is side effect of the focal point being too close to the camera.
You may want to switch the camera to parallel projection or change the focus point.
Here is a quick example to experiment with both
import pyvista as pv
mesh = pv.Cube(x_length=100,y_length=100,z_length=100).triangulate().subdivide(6,'linear')
p = pv.Plotter()
p.add_mesh(mesh,name="mesh",show_edges=True)
def toggle():
""" Toggle parallel_projection in camera """
value = not p.camera.parallel_projection
p.camera.parallel_projection = value
p.reset_camera()
def pick_center(pos):
print("New camera focal point", pos)
p.camera.focal_point = pos
p.update()
def enable_picking():
""" Toggle parallel_projection in camera """
p.enable_point_picking(callback=pick_center, show_message='Pick a point')
p.add_key_event('z', toggle)
p.add_key_event('c', enable_picking)
p.show()
```
1 Like