Fidgeting with the little screens

This commit is contained in:
Ben Hambrecht 2018-02-13 17:49:35 +01:00
parent 7dde8cfdf2
commit ea18fe08f1

View file

@ -1730,18 +1730,20 @@ class IPTScene1(PiCreatureScene):
# now move the light source to the height point # now move the light source to the height point
# while shifting scaling the screen # while shifting scaling the screen
screen1p = screen1#.deepcopy() screen1p = screen1.deepcopy()
screen1pp = screen1.deepcopy()
self.add(screen1p) #self.add(screen1p)
angle = np.arccos(length_b / length_c) angle = np.arccos(length_b / length_c)
vector = (H - C) * SCREEN_SCALE * 0.5 vector = (H - C) * SCREEN_SCALE * 0.5
screen1p.stretch_to_fit_width(screen_width_bp)
screen1p.rotate(-angle)
screen1p.shift(vector)
self.play( self.play(
ls1.move_source_to,H, ls1.move_source_to,H,
Transform(screen1,screen1p)
screen1p.stretch_to_fit_width,screen_width_bp,
screen1p.rotate,-angle,
screen1p.shift,vector,
) )
# add and move the second light source and screen # 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 # now move the light source to the height point
# while shifting scaling the screen # while shifting scaling the screen
screen2p = screen2#.deepcopy() screen2p = screen2.deepcopy()
screen2pp = screen2.deepcopy()
angle = np.arccos(length_a / length_c) 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( self.play(
ls2.move_source_to,H, ls2.move_source_to,H,
SwitchOff(ls1.ambient_light),
Transform(screen2,screen2p)
)
screen2p.stretch_to_fit_width,screen_width_ap,
screen2p.rotate,angle, # now transform both screens back
# we can reuse the translation vector self.play(
screen2p.shift,vector, Transform(screen1, screen1pp),
SwitchOff(ls1.ambient_light) Transform(screen2, screen2pp),
) )
@ -1806,5 +1816,3 @@ class IPTScene1(PiCreatureScene):