canvas-procedural-animation
它能做什么
这项技能通过代码驱动的运动,为动画场景加入天气、粒子和简单行走等效果。适合希望在不逐帧手绘的情况下,获得自然背景动态的动画师。
适用场景
- ✓当场景需要雨、雪、落叶或其他环境粒子时。
- ✓当角色需要简单的程序化行走,或挤压拉伸效果时。
- ✓当你希望在不手绘逐帧的情况下,为场景加入环境运动时。
技能链接
https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/canvas-procedural-animation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我动画中的公园场景里加入飘落的树叶和轻柔的风效。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体编写绘图代码,使每一帧都根据时间更新,从而使运动平滑。它使用 p5.js 或 Canvas 来实现粒子效果和简单的身体运动。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Canvas Procedural Animation
Use this skill when p5.js or Canvas is used for character-supporting motion: rain, snow, leaves, feathers, ambient particles, squash/stretch, or procedural walk cycles.
Proven Pattern
p5.js runs setup once and redraws continuously through draw(). Keep animation
state deterministic from time/frame values when rendering previews.
function setup() {
createCanvas(1920, 1080);
}
function draw() {
const t = millis() / 1000;
clear();
drawCharacter(width / 2, height / 2 + sin(t * 8) * 8);
}
Use For
- Particle/weather overlays.
- Environmental motion.
- Simple procedural bodies.
- Effects that do not need individually authored SVG parts.
Avoid For
- Complex facial acting where SVG/layered rig parts are easier to inspect.
- Final renders that need exact frame determinism unless the runtime exposes frame-index control.
Sources
- p5.js
setup()reference: https://p5js.org/reference/p5/setup/ - p5.js
draw()reference: https://p5js.org/reference/p5/draw/ - p5.js animation examples: https://p5js.org/examples/
常见问题
什么时候不应使用它?
复杂的面部表演应避免使用它,因为分层的部件更便于检查。
每一帧都能完全重现吗?
不一定。最终渲染可能需要一个能控制帧时序的运行环境。
它使用什么技术?
它使用 p5.js 和 HTML Canvas 绘图系统。
详情
作者的原始描述
Use p5.js/canvas for local procedural character effects: particles, weather, squash/stretch, walk cycles, and environmental motion.
repo: calesthio/OpenMontage
热度
- GitHub 星标
- 75k
- 排名
- #2644
- 许可证
- AGPL-3.0
- 更新时间
- 2026/10/28
评论
- …