最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Manim updater inside another updater - Stack Overflow

programmeradmin2浏览0评论

I have a question about Manim. The code below adds a new wave whenever time.get_value() > WAVE_DELAY is at the same position, and it's supposed to move right. I can see the wave show up. I expect it to move to the right, however it soon disappears. Any feedback would be appreciated.

def add_new_wave():
    new_wave = make_wave(LEFT*16, direction=1, stroke_color=BLUE, stroke_width=100)
    self.add(new_wave)
    new_wave.add_updater(lambda m: m.become(make_wave(LEFT*(16 if time.get_value() < WAVE_DELAY*0.5 else (16-(time.get_value()-WAVE_DELAY*0.5)*30), direction=1, stroke_color=BLUE, stroke_width=100)))

self.add_updater(lambda m: add_new_wave if time.get_value()> WAVE_DELAY else None)

WAVE_DELAY=0.7

发布评论

评论列表(0)

  1. 暂无评论