Manim
导出视频
在 manim
文件夹下面
1
| python -m manim .\mytst.py Position -pl
|
视频渲染选项
1 2 3
| -pm 1280*740 30fps -pl 854*480 15fps -p 2560*1440 60fps
|
如果渲染多个场景,把 p
换成 a
文字和位置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| class WriteText(Scene): def construct(self): text = TextMobject("This is some text") self.play(FadeIn(text), runtime=3) self.wait(1) self.remove(text) self.wait(1)
class Position(Scene): def construct(self): object = Dot() ReferenceText = TextMobject("text") self.add(object, ReferenceText)
object.to_edge(UP) self.wait() object.to_corner(UL, buff=1.50) self.wait() object.move_to(UP*2 + RIGHT) self.wait() vector = np.array([-3, -2, 0]) object.move_to(ReferenceText.get_center() + 5*RIGHT) self.wait() object.next_to(ReferenceText, RIGHT, buff=5) self.wait() object.shift(RIGHT) self.wait()
|
变换
1 2 3 4 5 6 7 8
| class Transform1(Scene): def construct(self): texto1 = TextMobject("First text") texto2 = TextMobject("Second text") self.play(Write(texto1)) self.wait() self.play(Transform(texto1, texto2)) self.wait()
|
所有改变都是改变第一个 texto1 = texto2
相当于赋值语句,也可以 ReplacementTransform
把当前物体变成后面一个
公式变换的例子
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| class TransformFormula(Scene): def construct(self): formula = TexMobject( "\\frac{d}{dx}", "(", "u", "+", "v", ")", "=", "\\frac{d}{dx}", "u", "+", "\\frac{d}{dx}", "v" ) formula.scale(2) self.play(Write(formula[0:7])) self.wait() self.play( ReplacementTransform(formula[2].copy(), formula[8]), ReplacementTransform(formula[4].copy(), formula[11]), ReplacementTransform(formula[3].copy(), formula[9]) ) self.wait() self.play( ReplacementTransform(formula[0].copy(), formula[7]), ReplacementTransform(formula[0].copy(), formula[10]) ) self.wait()
|
把变换存在数组里
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| class TransformFormula(Scene): def construct(self): formula = TexMobject( "\\frac{d}{dx}", "(", "u", "+", "v", ")", "=", "\\frac{d}{dx}", "u", "+", "\\frac{d}{dx}", "v" ) formula.scale(2) self.play(Write(formula[0:7])) self.wait() changes = [ [(2,4,3), (8,11,9)], [(0,0), (7,10)] ] for pre_ind, post_ind in changes: self.play( *[ ReplacementTransform(formula[i].copy(), formula[j]) for i,j in zip(pre_ind, post_ind) ] ) self.wait()
|
Inkscape
Inkscape 是一个制作图片的软件
移动界面
旋转
中间的那个叉叉是旋转中心,可以拖动它。
单击图片可以改变模式 : 放大缩小 <-> 旋转, 双击可以改变角度
创建的时候,拖动白色的符号可以改变轮廓的圆角
按住shift可以改变边框的颜色。不按是改变填充的颜色
After Effect
新建合成
点击这两个地方可以新建一个合成
预设默认 HDTV 1080 25
即可,
分辨率可以调整为1/4
如果电脑配置不好。持续时间是视频片段的时长。最后点击确定就创建好了
导入素材
双击这里可以导入素材