admin管理员组

文章数量:1302419

I am using pyvista to produce a gif animation. My object is a square [0,10]×[0,10] located on the xy-plane (z-coordinate = 0).

I want to set the camera position to the center of the square which is (5,5,0) when viewed from above. I used the following code:

plotter.camera.position = [5.0, 5.0, 25]
plotter.camera.focal_point = [5.0, 5.0, 0]
plotter.camera.roll += 90

However, the square becomes completely invisible. No matter how I use the mouse to reorient in the preview environment, I can not find the object at all.

Then I just changed it a little bit by

plotter.camera.focal_point = [4.999, 5.0, 0]

Then it appears. It seems that as long as camera.position and camera.focal_point have equal x- and y-coordinates (z-coordinates don't matter), the object always becomes invisible.

But, I would like to know what is going on here and understand how pyvista.camera works.

本文标签: pythonSet Pyvista Camera position object disappearStack Overflow