Threejs Earth Render

vibe-motion/skills/threejs-earth-render

作者 vibe-motion4c86c0d016a3ba22ee673428a494f3c44f84111f无许可证收录于 2026年10月9日更新于 2026年10月9日

Clone or update https://github.com/vibe-motion/threejs-earth and render the Three.js Earth route animation with Puppeteer frame capture. Use when users ask for 三维地球航线动画, Three.js Earth, 地球飞线, globe route animation, or exporting an Earth GIF/MP4/PNG sequence.

包含脚本Design & Creative
AI 生成的概览

通过 Puppeteer 捕获浏览器帧并编码为 GIF 或 MP4,渲染 Three.js 地球航线动画。

功能
克隆或更新固定的 Three.js Earth 仓库,通过本地 HTTP 服务器提供应用,并通过场景导出钩子逐帧定位来捕获可复现的 PNG 帧序列。随后使用 ffmpeg 将帧编码为 GIF 或 MP4,并打印最终输出的绝对路径。默认输出为 448 像素宽、30 fps 的 GIF,并支持指定工作区、输出路径、渲染比例以及跳过仓库更新。
适用场景
当用户需要 Three.js 地球航线动画,例如三维地球航线动画或地球飞线,或希望将地球动画导出为 GIF、MP4 或 PNG 序列时使用。也适用于在渲染前自定义默认杭州至巴黎航线的情况。
运行要求
需要 git、node、npm、ffmpeg,以及用于克隆或更新仓库、CDN 导入和安装 Puppeteer 的网络访问。该技能附带可执行脚本(一个 Python 渲染脚本和一个 Node 捕获脚本),并期望使用 /usr/local/bin/python3 下的 Python 3。

Three.js Earth Render

Workflow

  1. Use scripts/render_threejs_earth.py from this skill.
  2. Pass --workspace when the user specifies where the source checkout should live; otherwise use the current directory.
  3. Pass --output when the user specifies a GIF/MP4 path; otherwise use out/threejs-earth.gif.
  4. For customized routes, edit threejs-earth/src/routeConfig.js first and render with --skip-update so local edits are preserved.
  5. Run the script and wait for completion.
  6. Return the final absolute output path printed by the script.

Command

bash
/usr/local/bin/python3 scripts/render_threejs_earth.py \  --workspace "$(pwd)" \  --output "$(pwd)/out/threejs-earth.gif"

Installed Skill Resolution

Use the installed skill copy, not the source repo checkout:

bash
skill_dir=""for base in "${AGENTS_HOME:-$HOME/.agents}" "${CLAUDE_HOME:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}"; do  if [ -d "$base/skills/threejs-earth-render" ]; then    skill_dir="$base/skills/threejs-earth-render"    break  fidone[ -n "$skill_dir" ] || { echo "threejs-earth-render skill not found under ~/.agents, ~/.claude, or ~/.codex"; exit 1; }
/usr/local/bin/python3 "$skill_dir/scripts/render_threejs_earth.py" \  --workspace "$(pwd)" \  --output "$(pwd)/out/threejs-earth.gif"

Behavior

  • Repository source is fixed to https://github.com/vibe-motion/threejs-earth.git by default.
  • Reuse workspace/threejs-earth if it exists; otherwise clone it.
  • If the repo already exists, fetch and fast-forward the target branch unless --skip-update is passed.
  • Serve the Three.js app through a local HTTP server; do not open it with file://.
  • Use Puppeteer, not Remotion, because this is a browser-based 3D scene.
  • Seek each frame through window.__SCENE_3D_EXPORT__.setFrame(frame) so frames are independently reproducible.
  • Capture a PNG frame sequence, then encode .gif or .mp4 with ffmpeg.
  • Default render is a 30 fps GIF at 448 px wide. Use --output-width 0 to keep the native 2048 x 1152 capture.

Project Notes

  • Default route is Hangzhou to Paris in src/routeConfig.js.
  • The app exports a 16:9 scene at 2048 x 1152 for --render-scale 1 and 4096 x 2304 for --render-scale 2.
  • The scene uses CDN imports for Three.js and local high-resolution Earth texture assets, so network access is required on first load.

Requirements

  • git
  • node
  • npm
  • ffmpeg
  • network access for clone/update, CDN imports, and Puppeteer installation

来源与署名

来源:vibe-motion/skills位于threejs-earth-render提交4c86c0d

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架