python - 在 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)
所示的指定向右移动。
解决方案
我找到了同时做两个动画的正确方法
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))
推荐阅读
- c - 计算一个数字的除数的最佳算法是什么?
- python - 字符串中两个字母之间的距离
- docker - Traefik 未将请求路径传递给 Strapi CMS
- git - svn:从远程 git 存储库的特定提交中导出文件夹
- react-native - React Native Modal:透明背景和布局问题
- django - 黑客是如何产生这个 GET 请求的?
- odoo-12 - Odoo - 为什么 odoo 将 TransientModel 的数据(如 res.config.settings)存储到 ir.config_parameter 中?
- r - dplyr 中 group_by 的另一个大数据问题
- php - 加载 php_xdebug 失败
- jquery - jquery 中的 onblur 和 onfocus 事件有时在 IE 浏览器上无法正常工作