From 3b0c9581897d1a55a558e7649f35938b0b493030 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Tue, 31 Jan 2023 15:37:03 -0800 Subject: [PATCH] Check case of scale = 0 in get_view_matrix --- manimlib/camera/camera_frame.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manimlib/camera/camera_frame.py b/manimlib/camera/camera_frame.py index cd8b6792..deafefe3 100644 --- a/manimlib/camera/camera_frame.py +++ b/manimlib/camera/camera_frame.py @@ -92,13 +92,15 @@ class CameraFrame(Mobject): if refresh: shift = np.identity(4) rotation = np.identity(4) - scale = np.identity(4) + scale_mat = np.identity(4) shift[:3, 3] = -self.get_center() rotation[:3, :3] = self.get_inverse_camera_rotation_matrix() - scale[:3, :3] /= self.get_scale() + scale = self.get_scale() + if scale > 0: + scale_mat[:3, :3] /= self.get_scale() - self.view_matrix = np.dot(scale, np.dot(rotation, shift)) + self.view_matrix = np.dot(scale_mat, np.dot(rotation, shift)) return self.view_matrix