gpt4 book ai didi

manim - 如何更快地渲染 Manim 动画?

转载 作者:行者123 更新时间:2023-12-05 07:11:56 30 4
gpt4 key购买 nike

我发现当文本超过 20 行时,此动画需要花费大量时间来渲染。我可以做些什么来加快速度吗?

import itertools as it

class FormulaExample(Scene):
def setup(self):
self.text_example = Text("How are we doing?\nPlease help us\nimprove Stack Overflow.\nThanks!", font="Roboto", stroke_width=0)

class FadeInFromDirections(LaggedStart):
CONFIG = {
"directions":[DL,DOWN,DR,RIGHT,UR,UP,UL,LEFT],
"magnitude":1,
"lag_ratio":.05
}
def __init__(self, text , **kwargs):
digest_config(self, kwargs)
self.reverse_directions=it.cycle(list(reversed(self.directions)))
super().__init__(
*[FadeInFromPoint(obj,point=obj.get_center()+d*self.magnitude)
for obj,d in zip(text,self.reverse_directions)],
**kwargs
)

class FadeInFromDirectionsExample(FormulaExample):
def construct(self):
self.play(
FadeInFromDirections(self.text_example),
run_time=3
)
self.wait()

最佳答案

编译时,可以使用低质量模式,这将显着加快编译速度,(这对于预览来说已经足够好了)

关于manim - 如何更快地渲染 Manim 动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60579791/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com