在 manim 中发出带有 play() 函数的问题

问题描述

我运行此代码

from manimlib import *

class SquaretoCircle(Scene):
    def construct(self):
        circle = Circle()
        self.play(ShowCreation(circle))
        self.play(circle.animate.shift(2 * RIGHT),circle.animate.scale(0.25))

它是来自 https://3b1b.github.io/manim/getting_started/quickstart.html 的缩短示例。但是,圆圈​​没有按照 circle.animate.shift(2 * RIGHT) 的指定向右移动,如图 here 所示。

解决方法

我找到了同时做两个动画的正确方法

from manimlib import *

class SquareToCircle(Scene):
    def construct(self):
        circle = Circle()
        self.play(ShowCreation(circle))
        self.play(circle.animate.shift(2 * RIGHT).scale(0.25))

https://youtu.be/dwovjxTcvEk

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...