Skip to content

Releases

tinythree v0.4.0

Choose a tag to compare

@muskec06 muskec06 released this 17 Nov 12:37
f03e052

tinythree v0.4.0 makes one .t3 file work in both Three.js and Blender, and loads large, compressed glTF models.

New

  • Blender layer: mod, con, set, key, render, cam, spot, area, sky, hdri, haze, shade, terrain, curve, scatter, rigid and py blocks are kept in the parsed tree (ast.blender, ast.py) and skipped by Three.js. The same file builds a native Blender scene with tinythree-blender.
  • Compressed glTF models: model now loads Draco- and meshopt-compressed GLB files.

Fixes

  • Draco/meshopt GLBs used to load as an empty frame with no error.
  • Model load errors are no longer silent: they go to globalThis.tinythreeErrors, and tools/render.py stops with scene failed to load instead of recording a blank video.

Numbers

Tested with large real files: Littlest Tokyo (Draco, 141 k triangles, 30 s / 900 frames), Sponza (262 k triangles, 69 textures) and BrainStem (skinned, 35 s / 1,050 frames). Full-length videos render with the clip looping in step.

Littlest Tokyo scene tokens
tinythree 119
hand-written Three.js 831 (7.0×)
hand-written Blender Python 1,196 (10.1×)

Details: tinythree-blender/bench/GLB.md

tinythree v0.3.0

Choose a tag to compare

@muskec06 muskec06 released this 16 Nov 09:47

tinythree v0.3.0 adds content with one line each: text labels, glTF models, textures and a part library. Scenes that use them now need up to 6.9× fewer tokens than hand-written Three.js.

▶ Open the new Town Square scene in the playground

New

  • Text labels: text sign "Town Square" @0,4,0 bg=#1b2a4a s=1.4. Camera-facing sprites that also appear in rendered videos. top draws them above everything.
  • glTF / GLB models: model mill assets/windmill.glb @14,0,-12 play. play runs the model's own animations, driven by time, so videos are frame-exact. Video rendering waits for models to load.
  • Textures: mat brick map=brick rep=3,2. Use an image file/URL or one of 7 built-in procedural textures (checker, grid, brick, tiles, wood, grass, noise), drawn with a fixed seed.
  • Part library: use lib:tree t @-10,0,10 array=5,5,0,0. 13 real-size parts: tree, pine, bush, person, car, bench, streetlamp, door, window, column, fence, stairs, house.
  • New example, town-square.t3, plus a small animated test model (examples/assets/windmill.glb)

Fixes

  • Relative model and texture paths resolve against the .t3 file, in the playground and in tools/render.py
  • // starts a comment only at the start of a line or after whitespace, so https:// URLs survive
  • GitHub Actions moved off the deprecated Node 20 runtime

Numbers

Three.js tinythree
Town Square 3,207 464 6.9× fewer
All 11 scenes 14,151 4,057 3.5× fewer (was 3.0×)
  • Capability audit: 39/39 browser probes pass (docs/CAPABILITIES.md).
  • AI prompt: grew from ~1,400 to ~1,500 tokens.

tinythree v0.2.0

Choose a tag to compare

@muskec06 muskec06 released this 16 Nov 08:43

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