Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fix ThreeDScene.set_to_default_angled_camera_orientation() (#4704)

rsn516c8c8ba716
diff --git a/manim/scene/three_d_scene.py b/manim/scene/three_d_scene.py
index 7f39f4cf3..7d2337437 100644
--- a/manim/scene/three_d_scene.py
+++ b/manim/scene/three_d_scene.py
@@ -428,8 +428,8 @@ class ThreeDScene(Scene):
which have the same meaning as the parameters in set_camera_orientation.
"""
config = dict(
- self.default_camera_orientation_kwargs,
- ) # Where doe this come from?
+ self.default_angled_camera_orientation_kwargs,
+ )
config.update(kwargs)
self.set_camera_orientation(**config)
diff --git a/tests/module/scene/test_threed_scene.py b/tests/module/scene/test_threed_scene.py
index 24f6f2633..c39d66562 100644
--- a/tests/module/scene/test_threed_scene.py
+++ b/tests/module/scene/test_threed_scene.py
@@ -1,4 +1,4 @@
-from manim import Circle, Square, ThreeDScene
+from manim import DEGREES, Circle, Square, ThreeDScene
def test_fixed_mobjects():
@@ -15,3 +15,12 @@ def test_fixed_mobjects():
assert set(scene.camera.fixed_orientation_mobjects) == {s}
scene.remove_fixed_orientation_mobjects(s)
assert len(scene.camera.fixed_orientation_mobjects) == 0
+
+
+def test_set_to_default_angled_camera_orientation():
+ scene = ThreeDScene()
+
+ scene.set_to_default_angled_camera_orientation(phi=45 * DEGREES)
+
+ assert scene.camera.get_phi() == 45 * DEGREES
+ assert scene.camera.get_theta() == -135 * DEGREES