from manim import *
class CubeDemo(ThreeDScene):
    def construct(self):
        self.set_camera_orientation(phi=70 * DEGREES, theta=35 * DEGREES)
        title = Text("ThreeDScene：旋转的立方体", font="STLiti", font_size=30).to_edge(UP)
        self.add_fixed_in_frame_mobjects(title)
        cube = Cube(side_length=2, fill_color=BLUE, fill_opacity=0.7)
        self.begin_3dillusion_camera_rotation(rate=0.15)
        self.play(FadeIn(cube), run_time=0.8)
        self.play(Rotate(cube, axis=RIGHT, angle=2 * PI), run_time=3.4)
        self.stop_3dillusion_camera_rotation()
        self.wait(1.6)
