본문 바로가기
html5

manim TracedPath

by peach1227 2024. 5. 19.

 

 

class ClockwisePathExample(Scene):
    def construct(self):
        self.camera.background_color=WHITE
        colors = [RED, GREEN, BLUE]

        starting_points = VGroup(
            *[
                Dot(LEFT + pos, color=color)
                for pos, color in zip([ORIGIN, UP, DOWN], colors)
            ]
        )

        finish_points = VGroup(
            *[
                Dot(RIGHT + pos, color=color)
                for pos, color in zip([ORIGIN, UP, DOWN], colors)
            ]
        )

        self.add(starting_points)
        self.add(finish_points)
        for dot in starting_points:
            self.add(TracedPath(dot.get_center, stroke_color=dot.get_color(),stroke_width=4))

        self.wait()
        self.play(
            Transform(
                starting_points,
                finish_points,
                path_func=utils.paths.clockwise_path(),
                run_time=2,
            )
        )
        self.wait()



# don't remove below command for run button to work
%manim -qm -v WARNING ClockwisePathExample
반응형

'html5' 카테고리의 다른 글

manim linearTransform example  (0) 2024.05.26
manim boolean operation  (0) 2024.05.19
manim Growing  (0) 2024.05.17
manim hypocycloid example video  (0) 2024.05.16
manim animation mp4  (0) 2024.05.11