Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

circumvent aspect ratio arithmetic error when window is accidentally resized to h=0 #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyrender/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def get_projection_matrix(self, width=None, height=None):
if aspect_ratio is None:
if width is None or height is None:
raise ValueError('Aspect ratio of camera must be defined')
aspect_ratio = float(width) / float(height)
aspect_ratio = float(width) / (float(height) + 1e-6)

a = aspect_ratio
t = np.tan(self.yfov / 2.0)
Expand Down