Open-Source Project "img2threejs" Generates Procedural Three.js Models from Images
A new open-source project called "img2threejs" has been introduced, allowing users to convert reference images into code-only, procedural, and animation-ready Three.js models. The tool optimizes token usage by offloading mechanical tasks to deterministic scripts, making it highly efficient for AI agents. This project simplifies the creation of web-based 3D assets by generating clean, editable TypeScript/JavaScript code instead of heavy, static 3D file formats. It enables developers and AI agents to build lightweight, interactive 3D graphics directly within web applications. Unlike traditional image-to-3D pipelines that consume high amounts of tokens by repeatedly reading the entire model, img2threejs uses AI only where judgment is needed. The output is a quality-gated, procedural TypeScript model that can be easily animated and integrated into web projects.
## BACKGROUND
Three.js is a popular open-source JavaScript library used to create and display animated 3D computer graphics in web browsers using WebGL. Generative AI tools are increasingly being used to automate coding tasks, but generating complex 3D structures directly as clean, executable code remains a challenge due to high token costs and syntax errors.