CO2
CO2

Reputation: 101

Set Pyvista Camera position object disappear

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.

Upvotes: 0

Views: 36

Answers (0)

Related Questions