mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Fidgeting with the little screens
This commit is contained in:
parent
7dde8cfdf2
commit
ea18fe08f1
1 changed files with 23 additions and 15 deletions
|
@ -1730,18 +1730,20 @@ class IPTScene1(PiCreatureScene):
|
|||
|
||||
# now move the light source to the height point
|
||||
# while shifting scaling the screen
|
||||
screen1p = screen1#.deepcopy()
|
||||
|
||||
self.add(screen1p)
|
||||
screen1p = screen1.deepcopy()
|
||||
screen1pp = screen1.deepcopy()
|
||||
#self.add(screen1p)
|
||||
angle = np.arccos(length_b / length_c)
|
||||
vector = (H - C) * SCREEN_SCALE * 0.5
|
||||
|
||||
screen1p.stretch_to_fit_width(screen_width_bp)
|
||||
screen1p.rotate(-angle)
|
||||
screen1p.shift(vector)
|
||||
|
||||
|
||||
self.play(
|
||||
ls1.move_source_to,H,
|
||||
|
||||
screen1p.stretch_to_fit_width,screen_width_bp,
|
||||
screen1p.rotate,-angle,
|
||||
screen1p.shift,vector,
|
||||
Transform(screen1,screen1p)
|
||||
)
|
||||
|
||||
# add and move the second light source and screen
|
||||
|
@ -1778,17 +1780,25 @@ class IPTScene1(PiCreatureScene):
|
|||
|
||||
# now move the light source to the height point
|
||||
# while shifting scaling the screen
|
||||
screen2p = screen2#.deepcopy()
|
||||
screen2p = screen2.deepcopy()
|
||||
screen2pp = screen2.deepcopy()
|
||||
angle = np.arccos(length_a / length_c)
|
||||
screen2p.stretch_to_fit_width(screen_width_ap)
|
||||
screen2p.rotate(angle)
|
||||
# we can reuse the translation vector
|
||||
screen2p.shift(vector)
|
||||
|
||||
self.play(
|
||||
ls2.move_source_to,H,
|
||||
SwitchOff(ls1.ambient_light),
|
||||
Transform(screen2,screen2p)
|
||||
)
|
||||
|
||||
screen2p.stretch_to_fit_width,screen_width_ap,
|
||||
screen2p.rotate,angle,
|
||||
# we can reuse the translation vector
|
||||
screen2p.shift,vector,
|
||||
SwitchOff(ls1.ambient_light)
|
||||
|
||||
# now transform both screens back
|
||||
self.play(
|
||||
Transform(screen1, screen1pp),
|
||||
Transform(screen2, screen2pp),
|
||||
)
|
||||
|
||||
|
||||
|
@ -1806,5 +1816,3 @@ class IPTScene1(PiCreatureScene):
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue