본문 바로가기
html5

manim Homotopy

by peach1227 2024. 5. 30.

 

%%manim -qm -v WARNING HomotopyAnimationEffect

class HomotopyAnimationEffect(Scene):
    def construct(self):
        text=Tex("Hello World! GOOD").scale(3)
        self.play(Write(text),run_time=2)
        self.wait()
        FRAME_HEIGHT=10
        FRAME_Y_RADIUS=5
        def homotopy(x, y, z, t):
            alpha = (0.7 * x + FRAME_Y_RADIUS) / (FRAME_HEIGHT)
            beta = squish_rate_func(smooth, alpha-0.15, alpha+0.15)(t)
            return (x-0.3*np.sin(PI*beta), y,z)

        self.play(Homotopy(homotopy=homotopy,mobject=text),run_time=5)
        self.wait()

반응형

'html5' 카테고리의 다른 글

manim graph plot :  (0) 2024.05.29
manim ValueTracker class example  (0) 2024.05.28
manim linearTransform example  (0) 2024.05.26
manim boolean operation  (0) 2024.05.19
manim TracedPath  (0) 2024.05.19