Skip to content
CuteGuy☣️· @cutetoxicguy · X·· 29 d agoFeaturedAI score79

img2threejs: Reconstructing Editable 3D Models from Reference Images with Three.js Code

Editorial summary

The open-source skill img2threejs can be used by coding agents such as Claude Code, Codex, and OpenCode to build procedural 3D models from reference images using TypeScript and Three.js.

Why it matters

It converts reference-image reconstruction into an editable TypeScript generation program and demonstrates the concrete components and limitations of a procedural 3D workflow.

Original text

🎮 What if an AI coding agent could recreate almost any object from a reference image using nothing but Three.js code?

No downloaded 3D models. No photogrammetry. No mesh-generation API.

Meet img2threejs, an open-source skill for Claude Code, Codex, OpenCode and other coding agents.

It rebuilds objects and characters as fully procedural, editable 3D models written in TypeScript.

Here's the difference from ordinary image-to-3D AI.

Traditional models generate geometry that you then import into Blender or a game engine.

img2threejs generates a program that constructs the geometry.

A model can consist of:

▪️ Primitive shapes and custom procedural surfaces.

▪️ Parametric curves and measured geometric profiles.

▪️ Procedural materials and shaders.

▪️ Hierarchical object parts with named pivots.

▪️ Animation joints, sockets and collision geometry.

▪️ Skeletons and skinning systems for characters.

The resulting model is a THREE.Group factory.

You can modify its proportions, animate individual components and change its appearance by editing ordinary code.

But how does AI achieve visual accuracy?

The agent follows a structured reconstruction workflow.

1. Analyze the reference

Identify proportions, major forms, silhouettes and recognizable details.

2. Plan the geometry

Break the object into parts and choose suitable procedural representations.

3. Generate the model

Write TypeScript that creates the shapes, materials and component hierarchy.

4. Render and compare

Capture the generated object from matching camera angles.

5. Improve

Identify visual differences and refine the code until the model passes quality checks.

The process includes specific validation gates for geometry, visual similarity and animation behavior.

And the gallery demonstrates how far this can go.

The project includes live examples of:

▪️ A stylized tropical island.

▪️ Mechanical objects and vehicles.

▪️ Detailed procedural weapons.

▪️ Humanoid characters with articulated parts.

▪️ Interactive game scenes.

Every example runs directly in the browser, and its generated source code can be inspected.

Where would this be useful?

▪️ Procedural game environments.

▪️ Interactive websites.

▪️ Product configurators.

▪️ Lightweight 3D illustrations.

▪️ Animation-ready objects with editable parameters.

There are important trade-offs.

The output isn't guaranteed to perfectly match the reference.

Complex organic shapes and photorealistic surfaces can be difficult to reproduce with procedural geometry.

Generation also depends heavily on the coding agent's visual reasoning and its ability to inspect rendered results.

But the underlying idea is powerful.

Instead of generating another 3D asset, generate the code that knows how to build it.

That turns 3D reconstruction into an editable software engineering problem.

💻 github.com/img2threejs/img2th…

🎮 img2threejs.io

#ThreeJS #AICoding #3DArt #OpenSource

Source: CuteGuy☣️ · x.com