from manim import *
class ThreeDAxesRange(ThreeDScene):
    """3.1 三维坐标轴的范围与刻度。
    必须用 ThreeDScene 并 set_camera_orientation 转动相机，
    否则沿默认的 z 轴方向看过去，ThreeDAxes 只是一个平面十字。
    add_coordinates() 同样要在 FadeIn 之前调用。
    """
    def construct(self):
        self.set_camera_orientation(phi=65 * DEGREES, theta=-50 * DEGREES)
        title = Text("三维坐标轴：范围与刻度", font="STLiti", font_size=32).to_edge(UP)
        self.add_fixed_in_frame_mobjects(title)
        axes = ThreeDAxes(x_range=(-5, 5, 1.5), y_range=(-3, 3, 1),
                          z_range=(-2, 2, 0.5), x_length=8, y_length=5, z_length=4)
        axes.add_coordinates()
        self.play(FadeIn(title), run_time=0.6)
        self.play(FadeIn(axes), run_time=1.8)
        note = Text("range 第三位是刻度步长：x=1.5、y=1、z=0.5",
                    font="STLiti", font_size=22, color=YELLOW).to_edge(DOWN)
        self.add_fixed_in_frame_mobjects(note)
        self.play(FadeIn(note), run_time=0.6)
        self.wait(3.2)
