manim的方法第32部分


总览

我检查了manim的方法。
我尝试使用rate_func。

样例代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from manimlib.imports import *

class test(GraphScene):
    CONFIG = {
        "x_labeled_nums" : [],
        "y_labeled_nums" : [],
        "x_axis_label" : "Temperature",
        "y_axis_label" : "Pressure",
        "graph_origin" : 2.5 * DOWN + 2 * LEFT,
        "corner_square_width" : 4,
        "example_point_coords" : (2, 5),
    }
    def construct(self):
        self.setup_axes()
        path = VMobject().set_points_smoothly([ORIGIN, 2 * UP + RIGHT, 2 * DOWN + RIGHT, 5 * RIGHT, 4 * RIGHT + UP, 3 * RIGHT + 2 * DOWN, DOWN + LEFT, 2 * RIGHT])
        point = self.coords_to_point(*self.example_point_coords)
        path.shift(point)
        path.set_color(GREEN)
        self.play(ShowCreation(path, run_time = 10, rate_func = linear))
        self.wait()
        self.remove(path)
        self.play(ShowCreation(path, run_time = 10, rate_func = there_and_back))
        self.wait()
        self.remove(path)

产生的影片

https://www.youtube.com/watch?v=C6GRbNW-cyQ

或更多。