Skills2026年5月3日·1 分钟阅读

Zdog — Round Flat Designer-Friendly Pseudo-3D Engine

A 3D JavaScript engine for Canvas and SVG that renders shapes with a flat illustrative style, giving designers a simple API to create rotatable pseudo-3D graphics without WebGL.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Zdog Overview
通用 CLI 安装命令
npx tokrepo install de0cbf42-472e-11f1-9bc6-00163e2b0d79

Introduction

Zdog is a pseudo-3D engine that renders shapes with flat, round, designer-friendly aesthetics. It calculates 3D positions and rotations but draws shapes without perspective distortion or shading, producing an illustrated look that is unique compared to traditional 3D libraries.

What Zdog Does

  • Renders 3D scenes to Canvas or SVG without WebGL
  • Provides shape primitives: sphere, cylinder, cone, box, hemisphere, torus, and custom paths
  • Supports full 3D rotation, translation, and scaling with matrix transforms
  • Groups shapes into hierarchical scene graphs with parent-child relationships
  • Produces a flat-shaded illustrative style with consistent stroke rendering

Architecture Overview

Zdog uses a scene graph where each shape stores its 3D position, rotation, and geometry. On each render frame, it performs a depth sort of all shapes and draws them back-to-front using the painter's algorithm. Shapes are rendered as 2D paths with uniform stroke widths, creating the signature round flat look. No perspective projection is applied—objects do not shrink with distance, maintaining the illustration aesthetic.

Self-Hosting & Configuration

  • Install via npm or include from CDN as a script tag
  • Create an Illustration bound to a canvas or SVG element
  • Add shapes with addTo to build the scene graph hierarchy
  • Call updateRenderGraph() in an animation loop for interactive rotation
  • No build step required; works as a standalone ES module or global script

Key Features

  • Pseudo-3D rendering without WebGL dependency or GPU requirements
  • Flat illustration style produces clean vector-like output at any resolution
  • Scene graph with grouping (Anchor, Group) for modular 3D compositions
  • Path-based custom shapes with moveTo, lineTo, arc, and bezier commands
  • Lightweight at under 3KB gzipped with zero dependencies

Comparison with Similar Tools

  • Three.js — full 3D with lighting, textures, WebGL; Zdog is flat-styled without GPU
  • Babylon.js — game-grade 3D engine; Zdog targets illustrations, not photorealism
  • CSS 3D transforms — limited to flat planes; Zdog handles actual 3D geometry
  • Paper.js — 2D vector scripting; Zdog adds the third dimension
  • p5.js WEBGL mode — perspective 3D; Zdog's flat style is its defining feature

FAQ

Q: Can Zdog render complex 3D models? A: It handles dozens to hundreds of shapes well. For complex meshes with thousands of faces, use a WebGL engine instead.

Q: Does it support animations? A: Yes. Update rotation or position in a requestAnimationFrame loop and call updateRenderGraph() each frame.

Q: Can I export Zdog scenes as SVG? A: Yes. Use an SVG element as the render target and the output is standard SVG markup.

Q: Why no perspective? A: The flat orthographic style is an intentional design choice for an illustrated, toy-like aesthetic.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产