mirror of
https://github.com/3b1b/manim.git
synced 2025-11-13 23:27:49 +00:00
Add CameraFrame.to_fixed_frame_point
This commit is contained in:
parent
da9610b9f9
commit
91f69be3e0
1 changed files with 4 additions and 0 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue