From 7e4bd54da784f2361202f1c82c15fb5993de9f8a Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Wed, 28 Feb 2018 09:34:38 -0800 Subject: [PATCH] Tweaks to IPTScene --- active_projects/basel2.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/active_projects/basel2.py b/active_projects/basel2.py index 1bfde062..bb920165 100644 --- a/active_projects/basel2.py +++ b/active_projects/basel2.py @@ -2483,6 +2483,17 @@ class IPTScene(TwoLightSourcesScene, ZoomedScene): self.wait() # Show spotlight a key point + def show_beaming_light(spotlight): + triangle = get_spotlight_triangle(spotlight) + for x in range(3): + anims = [] + if x > 0: + anims.append(FadeOut(triangle.copy())) + anims.append(GrowFromPoint(triangle, triangle.points[0])) + self.play(*anims) + self.play(FadeOut(triangle)) + pass + def show_key_point(spotlight, new_point): screen = spotlight.screen update_spotlight_anim = UpdateFromFunc(spotlight, update_spotlight) @@ -2490,14 +2501,7 @@ class IPTScene(TwoLightSourcesScene, ZoomedScene): Transform(screen, screen.alt_version), update_spotlight_anim, ) - triangle = get_spotlight_triangle(spotlight) - for x in range(3): - anims = [] - if x > 0: - anims.append(FadeOut(triangle.copy())) - anims.append(GrowFromPoint(triangle, H)) - self.play(*anims) - self.play(FadeOut(triangle)) + show_beaming_light(spotlight) self.play(screen.restore, update_spotlight_anim) self.wait() self.play( @@ -2506,6 +2510,7 @@ class IPTScene(TwoLightSourcesScene, ZoomedScene): update_spotlight_anim, run_time = 2 ) + show_beaming_light(spotlight) self.wait() self.play( lsC.move_source_to, H,