animation原创
# 原点
ORIGIN
# scence.play
self.play(
# 一个play中可以有多个
Animation1(mob1,run_time=2), # run_time 必须设置 优先级高
Animation2(mob2), # 未设置 run_time 时会根据 paly 中的 run_time 执行
Animation3(mob3,run_time=3),
Animation4(..., rate_func=func1), # rate_func 动画速率函数
run_time=5 # 统一设置所有的动画时间,
rate_func=xxx # 统一设置所有的动画类型
)
# 动画速率函数 类型
# smooth 平滑
# linear 线性
# rush_into
# rush_form
# slow_into
# double_smeeth
# there_and_back
# lingering
# class anim.
经典动画
# Write
手写动画。
self.play(Write(Text("手写动画演示")))
# scale
缩放对象。必须放在self.play()中才能实现。
mob.scale(2) # 以自身中心放大2倍
mob.scale(0.5) # 以自身中心放大0.5倍
mob.scale(2,about_edge=UP) # 以自身上边为基准,放大2倍
mob.scale(2,about_edge=RIGHT) # 以自身右边为基准,放大2倍
mob.scale(2,about_point=np.array([-2,-2,0])) # 以某个点为基准,放大2倍
# rotate
对象旋转
mob.rotate(angle, axis= OUT [, about_point]) // 角度、轴(IN 顺时针, OUT 逆时针)、点(可选参数,默认为自身中心)
# flip
对象翻转。
mob.flip([axis= UP, about_point]) // 轴(默认为自身中心)、点(可选参数,默认为自身中心)
# stretch
拉伸对象。
(factor, dim [, about_point/about_edge]) // factor 拉伸的倍数 dim(dimension) 拉伸的方向(维度)
mob.stretch(factor=2,dim=0) # 沿X轴拉伸2倍
mob.stretch(factor=2,dim=1) # 沿Y轴拉伸2倍
mob.stretch(factor=2,dim=2) # 沿Z轴拉伸2倍
mob.stretch(factor=2,dim=2) # 沿Z轴拉伸2倍
# method anim.
# updateers
# simple updateers
# a updateers
# dt updateers
上次更新: 2022/08/24, 17:50:00