Rotation¶
Rotating¶
-
class
manimlib.animation.rotation.Rotating(mobject, angle=6.283185307179586, axis=array([0.0, 0.0, 1.0]), **kwargs)¶
RotatingExample¶
class RotatingExample(Scene):
def construct(self):
square=Square().scale(2)
self.add(square)
self.play(
Rotating(
square,
radians=PI/4,
run_time=2
)
)
self.wait(0.3)
self.play(
Rotating(
square,
radians=PI,
run_time=2,
axis=RIGHT
)
)
self.wait(0.3)
Rotate¶
-
class
manimlib.animation.rotation.Rotate(mobject, angle=3.141592653589793, axis=array([0.0, 0.0, 1.0]), **kwargs)¶
RotateExample¶
class RotateExample(Scene):
def construct(self):
square=Square().scale(2)
self.add(square)
self.play(
Rotate(
square,
PI/4,
run_time=2
)
)
self.wait(0.3)
self.play(
Rotate(
square,
PI,
run_time=2,
axis=RIGHT
)
)
self.wait(0.3)
请不要尝试直接使用 ApplyMethod 或 self.play(mob.rotate, ...) 来旋转,
因为这只是在当前和结果之间进行 Transform ,并无旋转效果