Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed small bug with Camera not properly transforming points

Grant Sanderson1f320a397485
diff --git a/manimlib/camera/camera.py b/manimlib/camera/camera.py
index ef2b60a38..c0843782c 100644
--- a/manimlib/camera/camera.py
+++ b/manimlib/camera/camera.py
@@ -345,10 +345,9 @@ class Camera(object):
# return self
def set_cairo_context_path(self, ctx, vmobject):
- # self.old_set_cairo_context_path(ctx, vmobject)
- # return
-
- points = vmobject.get_points()
+ points = self.transform_points_pre_display(
+ vmobject, vmobject.points
+ )
if len(points) == 0:
return
elif np.any(np.isnan(points)) or np.any(points == np.inf):
@@ -365,7 +364,7 @@ class Camera(object):
)
last_p3 = None
- quads = vmobject.get_cubic_bezier_tuples()
+ quads = vmobject.get_cubic_bezier_tuples_from_points(points)
ctx.new_path()
for p0, p1, p2, p3 in quads:
if should_start_new_path(last_p3, p0):
diff --git a/manimlib/camera/three_d_camera.py b/manimlib/camera/three_d_camera.py
index 32e30d230..3f8b92290 100644
--- a/manimlib/camera/three_d_camera.py
+++ b/manimlib/camera/three_d_camera.py
@@ -10,7 +10,6 @@ from manimlib.mobject.types.point_cloud_mobject import Point
from manimlib.mobject.value_tracker import ValueTracker
from manimlib.utils.color import get_shaded_rgb
from manimlib.utils.simple_functions import clip_in_place
-from manimlib.utils.space_ops import center_of_mass
from manimlib.utils.space_ops import rotation_about_z
from manimlib.utils.space_ops import rotation_matrix
@@ -190,7 +189,6 @@ class ThreeDCamera(Camera):
if fixed_in_frame:
return points
if fixed_orientation:
- # center = center_of_mass(points)
center_func = self.fixed_orientation_mobjects[mobject]
center = center_func()
new_center = self.project_point(center)