python - Manim updater inside another updater - Stack Overflow

I have a question about Manim. The code below adds a new wave whenever time.get_value() > WAVE_DELAY

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742320222a4421657.html

相关推荐

  • python - Manim updater inside another updater - Stack Overflow

    I have a question about Manim. The code below adds a new wave whenever time.get_value() > WAVE_DELAY

    10小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信