Add CameraFrame.to_fixed_frame_point

This commit is contained in:
Grant Sanderson 2023-01-28 22:30:00 -08:00
parent da9610b9f9
commit 91f69be3e0

View file

@ -183,3 +183,7 @@ class CameraFrame(Mobject):
to_camera = self.get_inverse_camera_rotation_matrix()[2]
dist = self.get_focal_distance()
return self.get_center() + dist * to_camera
def to_fixed_frame_point(self, point: Vect3):
view = np.linalg.inv(self.get_view_matrix())
return np.dot([*point, 1], view)[:3]