You have a picture of a bike, a pair of earbuds or a treasure chest. You want it spinning in 3D on a web page. The usual path is a 3D artist, Blender, or a paid model download. There is another way now: let an AI coding agent rebuild the object from scratch in Three.js, using only code.
No mesh file. No photogrammetry. The model is made of basic shapes (boxes, cylinders, curves), generated geometry and shaders, all written as code that runs in the browser.
The trick is not to ask for the whole thing at once. Good results come from building in passes, and checking each pass against the photo before moving on:
After every pass the agent renders the model, looks at it next to the photo, and fixes what does not match. That loop is what makes it work.
An open source project called img2threejs packages this whole method as a skill for Claude Code, Codex or OpenCode, with quality gates between the steps. You can also run the same idea by hand with any coding agent.
Here is a reference photo of [OBJECT]. Rebuild it as a procedural Three.js model in one TypeScript file that returns a THREE.Group. Use only primitives, generated geometry and shader materials. No external model files.
Work in passes and stop after each one to show me a render next to the photo:
1. List every identity detail you see (shapes, edges, screws, logos, materials, wear).
2. Blockout with correct proportions.
3. Real parts with pivots for anything that moves ([MOVING PARTS]).
4. Materials per region.
5. Lighting and a simple orbit-camera demo page.
At each pass, say what still does not match the photo and fix it before moving on.
Do I need to know Three.js? No. You need to be able to run the page the agent builds and say what looks wrong.
How long does it take? A simple object: minutes. A detailed one: several rounds of passes. The pass-by-pass checking is where the time goes, and also where the quality comes from.
Can I use any photo? Use photos of objects you own or have rights to. A clean photo with plain background and good light gives the best result.