概要
manimの作法、調べてみた。
TracedPath使ってみた。
サンプルコード
from manimlib.imports import *
class test(Scene):
def construct(self):
grid = NumberPlane()
self.add(grid)
t = ValueTracker(0)
dot = Dot(color = BLACK, background_stroke_color = WHITE, background_stroke_width = 2, radius = 0.06)
dot.add_updater(lambda m: m.move_to(np.array([2 * np.sin(3 * t.get_value()) * np.cos(t.get_value()), 2 * np.sin(3 * t.get_value()) * np.sin(t.get_value()), 0])))
path = TracedPath(dot.get_center, stroke_color = RED, stroke_width = 6, plot_depth = -2)
self.add(path)
self.play(Write(dot))
self.play(t.set_value, PI, run_time = 6, rate_func = linear)
self.wait()
生成した動画
以上。