mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Fix ThreeDScene.set_to_default_angled_camera_orientation() (#4704)
Co-authored-by: neeh <rapetisiddhu@gmail.com> Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
This commit is contained in:
parent
ccee37a614
commit
516c8c8ba7
2 changed files with 12 additions and 3 deletions
|
|
@ -428,8 +428,8 @@ class ThreeDScene(Scene):
|
||||||
which have the same meaning as the parameters in set_camera_orientation.
|
which have the same meaning as the parameters in set_camera_orientation.
|
||||||
"""
|
"""
|
||||||
config = dict(
|
config = dict(
|
||||||
self.default_camera_orientation_kwargs,
|
self.default_angled_camera_orientation_kwargs,
|
||||||
) # Where doe this come from?
|
)
|
||||||
config.update(kwargs)
|
config.update(kwargs)
|
||||||
self.set_camera_orientation(**config)
|
self.set_camera_orientation(**config)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from manim import Circle, Square, ThreeDScene
|
from manim import DEGREES, Circle, Square, ThreeDScene
|
||||||
|
|
||||||
|
|
||||||
def test_fixed_mobjects():
|
def test_fixed_mobjects():
|
||||||
|
|
@ -15,3 +15,12 @@ def test_fixed_mobjects():
|
||||||
assert set(scene.camera.fixed_orientation_mobjects) == {s}
|
assert set(scene.camera.fixed_orientation_mobjects) == {s}
|
||||||
scene.remove_fixed_orientation_mobjects(s)
|
scene.remove_fixed_orientation_mobjects(s)
|
||||||
assert len(scene.camera.fixed_orientation_mobjects) == 0
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue