Fix bug of rotating camera

This commit is contained in:
widcardw
2021-10-18 21:00:25 +08:00
committed by GitHub
parent 305ca72ebe
commit 872ef67cf7

View File

@ -66,8 +66,8 @@ class CameraFrame(Mobject):
curr_rot_T = self.get_inverse_camera_rotation_matrix()
added_rot_T = rotation_matrix_transpose(angle, axis)
new_rot_T = np.dot(curr_rot_T, added_rot_T)
Fz = clip(new_rot_T[2], -1, 1)
phi = np.arccos(Fz[2])
Fz = new_rot_T[2]
phi = np.arccos(clip(Fz[2], -1, 1))
theta = angle_of_vector(Fz[:2]) + PI / 2
partial_rot_T = np.dot(
rotation_matrix_transpose(phi, RIGHT),