mirror of
https://github.com/3b1b/manim.git
synced 2025-07-27 03:52:20 +08:00
Switch old syntax for animating methods to .animate syntax
This commit is contained in:
@ -12,11 +12,11 @@ class SquareToCircle(Scene):
|
||||
self.play(ReplacementTransform(square, circle))
|
||||
self.wait()
|
||||
# Try typing the following lines
|
||||
# self.play(circle.stretch, 4, {"dim": 0})
|
||||
# self.play(circle.animate.stretch(4, dim=0))
|
||||
# self.play(Rotate(circle, TAU / 4))
|
||||
# self.play(circle.shift, 2 * RIGHT, circle.scale, 0.25)
|
||||
# self.play(circle.animate.shift(2 * RIGHT), circle.animate.scale(0.25))
|
||||
# circle.insert_n_curves(10)
|
||||
# self.play(circle.apply_complex_function, lambda z: z**2)
|
||||
# self.play(circle.animate.apply_complex_function(lambda z: z**2))
|
||||
|
||||
class SquareToCircleEmbed(Scene):
|
||||
def construct(self):
|
||||
@ -26,12 +26,12 @@ class SquareToCircleEmbed(Scene):
|
||||
|
||||
self.add(circle)
|
||||
self.wait()
|
||||
self.play(circle.stretch, 4, {"dim": 0})
|
||||
self.play(circle.animate.stretch(4, dim=0))
|
||||
self.wait(1.5)
|
||||
self.play(Rotate(circle, TAU / 4))
|
||||
self.wait(1.5)
|
||||
self.play(circle.shift, 2 * RIGHT, circle.scale, 0.25)
|
||||
self.play(circle.animate.shift(2 * RIGHT), circle.animate.scale(0.25))
|
||||
self.wait(1.5)
|
||||
circle.insert_n_curves(10)
|
||||
self.play(circle.apply_complex_function, lambda z: z**2)
|
||||
self.play(circle.animate.apply_complex_function(lambda z: z**2))
|
||||
self.wait(2)
|
||||
|
Reference in New Issue
Block a user