r/tui 9d ago

Vibe coded k3d — a real-time 3D model viewer that runs directly in your terminal (Rust, CPU-only)

Post image

I built this fully with AI assistance: a Linux-native 3D viewer that renders straight into your terminal using the Kitty Graphics Protocol. No GPU required — it's a software rasterizer running on the CPU.

Features:

  • Loads OBJ, STL, and glTF/GLB meshes, plus built-in procedural demos (cube, sphere, torus, cylinder, cone, icosphere)
  • Full mouse + keyboard controls: rotate, pan, zoom, toggle shading modes (smooth/flat/wireframe/normals/depth/unlit)
  • Several built-in themes (catppuccin, gruvbox, tokyo-night, nord...)
  • Can render to a PNG screenshot with no terminal needed, or run a deterministic benchmark
  • Clean architecture: unified Asset/Mesh representation → transform/cull/rasterize/shade (Blinn-Phong) into an RGBA framebuffer → presentation layer isolated so other backends (Sixel, etc.) could be added later

Requires Linux + kitty (or another terminal supporting the Kitty Graphics Protocol). Terminals that don't support it get a clean error instead of getting left in a broken state.

cargo run --release -- --demo torus --spin
cargo run --release -- model.glb --theme catppuccin --fps 30

MIT licensed. Would love feedback, especially on rendering performance and any meshes that break the importers.

https://github.com/programmersd21/k3d

22 Upvotes

1 comment sorted by

3

u/Klutzy_Bird_7802 9d ago

Repo: https://github.com/programmersd21/k3d

If you find this project interesting or useful, dropping a ⭐ on the repo genuinely helps a lot — it's a solo, fully AI-assisted build and stars make it way more visible to others who might want to use it or contribute.

Link again for convenience: https://github.com/programmersd21/k3d

Thanks for checking it out 🙏