Merge pull request #1655 from widcardw/master

Fix the bug of rotating camera
This commit is contained in:
Grant Sanderson 2021-10-18 07:01:58 -07:00 committed by GitHub
commit f77e25ff86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,7 @@ class CameraFrame(Mobject):
added_rot_T = rotation_matrix_transpose(angle, axis)
new_rot_T = np.dot(curr_rot_T, added_rot_T)
Fz = new_rot_T[2]
phi = np.arccos(Fz[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),