Skip to content

tinythree v0.2.0

Choose a tag to compare

@muskec06 muskec06 released this 16 Nov 08:43
· 15 commits to main since this release

First public release of tinythree: a tiny 3D scene language that compiles to Three.js, designed so AI models can write 3D scenes with ~3× fewer tokens.

▶ Try the playground: edit a scene and watch it update as you type.

Highlights

  • Compact syntax for shapes, materials, lights, shadows, fog, groups, clones and copies (mirror, array, grid, radial)
  • truss lattices: one line builds a steel lattice tower segment (posts, rings, X braces) drawn as one instanced mesh. The detailed Eiffel Tower has ~1,400 beams in 57 lines.
  • Animation: spin, wave, chained to tweens with easing, camera orbit, all pure functions of time
  • Frame-exact video: tools/render.py renders MP4, ProRes 4444 or WebM with alpha for educational videos
  • Full Three.js reach: js, tick and renderer blocks take raw Three.js for glTF models, shaders, particles, post-processing, environment maps and WebXR. 35/35 capability probes pass (docs/CAPABILITIES.md).
  • LLM-friendly errors, e.g. line 7: unknown command "spehre" (did you mean "sphere"?)
  • Zero dependencies: one ~600-line ES module that runs in the browser and in Node, with a CLI (build, compile, check)

Benchmark

10 scenes, each written in tinythree and as hand-written, idiomatic Three.js. Both versions were rendered to confirm they draw the same scene.

Three.js tinythree
Total tokens 10,944 3,593 3.0× fewer
Eiffel Tower 3,028 1,117 2.7×
London Eye 1,011 305 3.3×

The AI prompt that teaches the language is ~1,400 tokens and pays for itself after about two scenes. Tokens were counted with OpenAI's o200k tokenizer.

Examples

Eiffel Tower · Leaning Tower of Pisa · Pyramids of Giza · Stonehenge · London Eye · Construction site · Solar plant · Desk lamp · Atom · Vector addition