from manim import *
class FixedOrientationDemo(ThreeDScene):
    def construct(self):
        self.set_camera_orientation(phi=70 * DEGREES, theta=30 * DEGREES)
        title = Text("ThreeDScene：固定方向的对象", font="STLiti", font_size=28).to_edge(UP)
        self.add_fixed_in_frame_mobjects(title)
        axes = ThreeDAxes(x_length=6, y_length=6, z_length=4)
        label = Text("3D 标签", font="STLiti", font_size=32, color=GREEN).shift(RIGHT * 2 + UP * 1.2)
        self.add_fixed_orientation_mobjects(label)
        self.add(axes, label)
        note = Text("相机转动时，绿色标签始终保持固定朝向", font="STLiti",
                    font_size=20, color=YELLOW).to_edge(DOWN)
        self.add_fixed_in_frame_mobjects(note)
        self.wait(1.0)
        self.move_camera(theta=-30 * DEGREES, run_time=2.4)
        self.wait(2.6)
