Files
QingLong/AI/Manim/generative-manim/datasets/code/RotationUpdater.py
2025-08-15 09:13:13 +08:00

21 lines
657 B
Python

from manim import *
class RotationUpdater(Scene):
def construct(self):
def updater_forth(mobj, dt):
mobj.rotate_about_origin(dt)
def updater_back(mobj, dt):
mobj.rotate_about_origin(-dt)
line_reference = Line(ORIGIN, LEFT).set_color(WHITE)
line_moving = Line(ORIGIN, LEFT).set_color(YELLOW)
line_moving.add_updater(updater_forth)
self.add(line_reference, line_moving)
self.wait(2)
line_moving.remove_updater(updater_forth)
line_moving.add_updater(updater_back)
self.wait(2)
line_moving.remove_updater(updater_back)
self.wait(0.5)