main
黄海 5 months ago
parent 8a2ba43797
commit ed0ff5618b

@ -0,0 +1,19 @@
# simple_example.py
from manim import *
class SimpleScene(Scene):
def construct(self):
# 创建圆形
circle = Circle(color=BLUE)
# 创建文字标签
label = Text("Hello Manim!", font_size=24).next_to(circle, DOWN)
# 显示动画
self.play(Create(circle))
self.play(Write(label))
self.wait(1) # 暂停1秒
# 变换为正方形
square = Square(color=RED)
self.play(Transform(circle, square))
self.wait(1)

@ -0,0 +1,39 @@
# 0、参考文档
https://www.toutiao.com/article/6966561690787873284/
# 1、创建python3.10虚拟环境
conda create -n manim-env python=3.10 -y
# 2、激活python3.10虚拟环境
conda activate manim-env
# 3、添加到环境变量【必须否则报错CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to download and install packages.】
D:\anaconda3\Library\bin
# 4、安装manim
conda install -c conda-forge numpy=1.23.5 scipy=1.9.3 --show-channel-urls -y
# 5. 下载安装MiKTeX国内用户建议使用清华镜像
https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/win32/miktex/setup/windows-x64/basic-miktex-23.10-x64.exe
# 验证
latex --version
# 6、下载安装
ffmpeg
# 7、安装manim
pip install pycairo -i https://mirrors.aliyun.com/pypi/simple/
pip install sox -i https://mirrors.aliyun.com/pypi/simple/
pip install manim -i https://mirrors.aliyun.com/pypi/simple/
# 验证版本
manim --version
# 8、测试
conda activate manim-env
manim D:\dsWork\QingLong\AI\Manim\example_scenes.py
manim -pql D:\dsWork\QingLong\AI\Manim\example_scenes.py SceneName
manim -pql D:\dsWork\QingLong\AI\Manim\simple_example.py SimpleScene

@ -1,6 +1,8 @@
# Manim 一款使用python便可以做出高大上的数学教学动画安装篇
# https://www.toutiao.com/article/6966561690787873284/
# 安装环境
pip install manimgl
# ffmpeg
https://www.wikihow.com/Install-FFmpeg-on-Windows

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save