Skip to content

what is the best way to automatically find a good angle/position of the camera when looking at a 2d plane? #1417

Answered by tkoyama010
chen112p asked this question in Q&A
Discussion options

You must be logged in to vote

@chen112p

I have a few 2d planes with some scalar data (might not always be perfect 2D, but relatively 2D, or would like to be viewed as 2d planes). I would like to know what would be the best way to automatically fit them in to the frame and put the camera direction perpendicular to the center of the plane. Basically I am trying to find a good way to define their positioning by my data's traits (for example width, length, diagonal, figure center, cell normals...).

It is depends on what axes your 2D data is on. If it is on X-Y axis, Your camera direction must be (0.0, 0.0, -1.0).
Sorry but pyvista does not have function to fit mesh automatically. You would have to adjust the camera posi…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by chen112p
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JLee2022
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #1416 on June 22, 2021 17:47.