예제 #1
0
 def construct(self):
     start_curve = SnakeCurve(order = 6)
     end_curve = SnakeCurve(order = 7)
     start_dots, end_dots = [
         Mobject(*[
             Dot(
                 curve.get_points()[int(x*curve.get_num_points())],
                 color = color
             )
             for x, color in [
                 (0.202, GREEN),
                 (0.48, BLUE),
                 (0.7, RED)
             ]
         ])
         for curve in (start_curve, end_curve)
     ]
     self.add(start_curve)
     self.wait()
     self.play(
         ShowCreation(start_dots, run_time = 2),
         ApplyMethod(start_curve.fade)
     )
     end_curve.fade()
     self.play(
         Transform(start_curve, end_curve),
         Transform(start_dots, end_dots)
     )
     self.wait()
예제 #2
0
 def construct(self):
     start_curve = SnakeCurve(order = 6)
     end_curve = SnakeCurve(order = 7)
     start_dots, end_dots = [
         Mobject(*[
             Dot(
                 curve.points[int(x*curve.get_num_points())],
                 color = color
             )
             for x, color in [
                 (0.202, GREEN),
                 (0.48, BLUE),
                 (0.7, RED)
             ]
         ])
         for curve in start_curve, end_curve
     ]
     self.add(start_curve)
     self.dither()
     self.play(
         ShowCreation(start_dots, run_time = 2),
         ApplyMethod(start_curve.fade)
     )
     end_curve.fade()
     self.play(
         Transform(start_curve, end_curve),
         Transform(start_dots, end_dots)
     )
     self.dither()
예제 #3
0
    def construct(self):
        grid = Grid(16, 16).fade()
        snake_curve = SnakeCurve(order=4)
        words = TextMobject("``Snake Curve''")
        words.next_to(grid, UP)

        self.add(grid)
        self.play(ShowCreation(snake_curve, run_time=7, rate_func=None))
        self.wait()
        self.play(ShimmerIn(words))
        self.wait()