How to turn a single car photo into a walk-around 3D scene with Grok Bot
The author shows how to use Grok Bot to turn a photo of a 1975 AMC Pacer into a draggable 2.5D scene that can be viewed around. Cold start took 87 seconds, ran on the CPU, and cost $0. The workflow uses Depth Anything V2 Small to generate a depth map, then exports a textured scene.glb, a single-file three.js viewer, MP4, and GIF. A single photo cannot provide hidden geometry such as the back of the car, so the result is not a true 360-degree model.
The article breaks down the complete process for generating an interactive 2.5D scene from a single photo and explains the method's boundaries with concrete timings, file specifications, and failure fixes.
I turned one flat photo of a 1975 AMC Pacer into a 3D scene you can orbit, in 87 seconds on a CPU, for $0. Grok Bot built the depth map, mesh, viewer and looping GIF. Here are the exact prompts, the fixes, the repo and how to scale it to a full 360 car.

The finished 3D loop plays at the top of the repo page: https://github.com/swiftverse/photo-to-3d-grokbot
That loop started as one flat photo of a yellow 1975 AMC Pacer parked on the grass at a classic car show. No turntable, no second photo, no scanner. Grok Bot estimated depth for every pixel, built a textured 3D mesh from it, put the mesh in a browser viewer you can drag around, and rendered a camera move that orbits the car while the fence, the tennis court and the tree behind it slide past. The whole run took 87 seconds on a CPU, including downloading the depth model, and cost nothing.
This post covers what I asked for, what happened at each step, the real numbers, the three things the first render got wrong and how they were fixed, and how to take it much further, up to a full 360 degree car model. The code is open, so you can run it on your own car photos: https://github.com/swiftverse/photo-to-3d-grokbot
What you actually get from one photo
One photo has one viewpoint. Any method that starts from a single image can only estimate the shape of what the camera saw, and it knows nothing about what is hidden. So the result is 2.5D: a surface that bends toward and away from you like a relief sculpture, with the photo painted on it. Close to the original camera position it reads as fully 3D, because your eye reads parallax: the bumper moves against the grass, the roofline moves against the fence, and the trees at the back barely move.
Swing the camera too far and the illusion breaks. The far side of this Pacer, its roof and the ground under it do not exist in the data. That is not a bug in the pipeline, it is what one photo contains. The expansion section covers the methods that produce a car you can walk all the way around, and every one of them needs more input or a generative model that invents the missing side.
For a listing photo, a product page or a social post, 2.5D is often enough, and every pixel you see from the front is a real pixel from the photo.
The output files
One command produced these files from one 1280x863 JPEG:
🗺️ depth.png: a colour-coded depth map, bright for near and dark for far
🧊 scene.glb: a textured 3D mesh, 272,694 vertices and 536,866 triangles, 12.8 MB, opens in Blender, three.js, Windows 3D Viewer or any glTF viewer
🖱️ viewer.html: one 17.9 MB file with the mesh and three.js inside it, opened straight from disk, drag to orbit and scroll to zoom
🎬 orbit.mp4: a seamless 5 second loop at 1280x720 and 30 fps, 6.2 MB
🔁 orbit.gif: the same loop at 560x315, 75 frames, 9.6 MB, small enough to play smoothly on a GitHub README and well under the 15 MB GIF limit on X
The pipeline
The whole thing in one line:
CAR PHOTO 1280x863 → [1] Depth Anything V2 Small on CPU → inverse depth per pixel → [2] 512x345 vertex grid back-projected through a pinhole camera → trim triangles at depth edges + build a background fill layer → scene.glb → [3] three.js viewer in one HTML file → [4] headless Chrome renders 150 frames → orbit.mp4 → orbit.gif
Step times from the tested run: depth 12.0 s cold (including the model download) and 4.1 to 4.8 s warm, mesh and fill 0.6 to 0.8 s, viewer 0.04 s, video 74 to 79 s. The video is the slow step only because the box has no GPU and Chrome falls back to software WebGL.
The setup
Grok Bot has its own Linux computer, so it installs packages, runs code, renders files and looks at the results itself. This one had 8 CPU cores, no GPU, Python 3.13 and Google Chrome. I did not open a terminal; everything below came from chat messages.
Step 1: pick a car photo with real depth
The photo matters more than any setting. Depth estimation needs layers: something close to the camera, a middle ground and a background. A car shot straight from the side against a wall is nearly flat. A car shot at a three-quarter angle, with the front corner nearest the camera and open space behind it, has depth inside the subject itself (bumper, hood, windscreen, roof) and behind it.
Prompt I used:
"Find me a CC0 or public domain photo of a single car on Wikimedia Commons, shot at a three-quarter angle with clear depth: the car close to the camera, then grass or road, then a background. No readable number plates, no recognisable faces. Give me the file page URL, the author and the exact licence, then download a 1280px version and show it to me."
It searched Commons through the public API, pulled licence metadata for about 120 results, and looked at a contact sheet of eight CC0 candidates, skipping one with a person beside the car and one with a readable plate. The pick was "1975 AMC Pacer base model at 2012 Rockville e" by CZmarlin (Christopher Ziemnowicz), released under CC0. The car fills the front of the frame at a three-quarter angle, the grass runs back to a chain-link fence and a tennis court, and trees and a big trunk close off the background. Four clear depth layers. There is no front plate on the car.
CC0 means no permission and no credit are legally required. The photographer asks for a credit anyway, so it stays in the demo viewer, the repo and this post. The original is 2269x1530; the 1280 px version is plenty for a depth model that works at 518 px internally.
Step 2: the depth map
Prompt:
"On your box, install CPU PyTorch and transformers, run Depth Anything V2 Small (depth-anything/Depth-Anything-V2-Small-hf) on car.jpg, and save a colourised depth map plus a side by side of photo and depth. Time the step and show me the side by side."
The photo next to its depth map is in the repo at assets/photo_vs_depth.jpg.
Depth Anything V2 Small is an open monocular depth model with 24.8 million parameters and an Apache-2.0 licence. The weights are about 99 MB. On this CPU it ran in 4.1 to 4.8 s once cached, and 12.0 s on a cold start including the download.
The depth map shows why the photo works: the bumper and near wheel are brightest, the hood shades toward the windscreen, and the background drops to deep purple. The tree trunk on the right is correctly placed in front of the fence.
One technical detail drives the rest. This model returns relative inverse depth: bigger means closer, and the scale is unknown. It knows the bumper is much closer than the fence, but not that it is 2 metres away. So the next step has to choose a depth range. I used near 1.0 and far 9.0 in arbitrary units. A larger far value exaggerates the 3D, a smaller one flattens it.
Step 3: from depth map to mesh
Prompt:
"Turn the depth map into a textured 3D mesh: back-project a 512 wide vertex grid through a pinhole camera with a 60 degree horizontal FOV, map inverse depth to a 1 to 9 depth range, use the photo as the texture, and delete triangles that stretch across depth edges (depth ratio above 1.05). Export scene.glb and tell me the vertex and face counts."
In plain terms: a 512x345 grid of points, 176,640 in total, is laid over the photo. Each point takes a depth from the map and is pushed out from a virtual camera along the ray through its pixel. Two triangles per cell join the points into a surface textured with the photo. Seen from the origin it reproduces the photo exactly; move the camera and the depth appears.
The naive version has a well-known flaw. Where the hood meets the grass behind it, depth jumps from about 1.35 to about 2.75 within three grid cells, and the triangles across that jump stretch into a long rubber sheet that smears yellow paint over the lawn. The fix is to delete any triangle whose farthest corner is more than 5% deeper than its nearest one. On this photo that removed 9,624 of 351,568 triangles, 2.74%, all of them on object edges: the car outline, the tree trunk and the fence posts.
Step 4: fill what the camera can see behind the car
Trimming fixes the smears but leaves holes. When the camera swings right, it looks past the edge of the hood into nothing. The fix is a second mesh behind the first: a background layer where the car has been removed, so the newly visible strip shows something plausible.
Prompt:
"Add a second background layer behind it with the car removed, so moving the camera does not reveal empty holes."
The filled background layer, with the car removed, is in the repo at assets/background_inpainted.jpg.
The first version of this layer failed on the car (see the fixes section). The final version works like this. For depth, a wide, short minimum filter (80% of the image width, 9 rows tall) on the inverse-depth grid replaces each pixel with the farthest value found to its left or right, which pushes the car back to the depth of the grass and fence beside it. Pixels that moved are marked as occluders: 46.8% of the grid, almost all of it the car. For colour, each row of the car region is filled by mirroring the background on either side of the gap and cross-fading the two copies. Only the strip right next to the car ever becomes visible, and there the mirror copies real grass from a few pixels away. The layer sits 3% behind the main mesh at half resolution, and it extends 20% past every edge of the photo with mirrored texture, so the end of the swing never shows empty space.
Mesh, trimming, fill layer and .glb export together took 0.6 to 0.8 s.
Step 5: a viewer you can drag
Prompt:
"Build one self-contained HTML file with three.js that embeds the .glb and lets me drag to orbit, scroll to zoom and double-click to reset. Limit the orbit so I cannot swing far enough to see the back of the scene. No CDN, everything inline."
A before and after of one drag in the viewer is in the repo at assets/viewer_drag.jpg.
The bot bundled three.js r187 with OrbitControls and GLTFLoader into one 0.82 MB script and embedded it in an HTML page with the .glb as base64. The result is one 17.9 MB file that opens offline with a double-click. It uses an unlit material, because the photo already contains the real sunlight on the paint, and virtual lighting on top makes it look like plastic.
The orbit is clamped to 10 degrees sideways and 8 degrees up or down. The first limit was 14 degrees; a scripted drag in headless Chrome pushed to that limit and the screenshot showed the right edge of the scene peeling off. Clamping is the honest answer for 2.5D. The field of view adapts to the window shape so the photo fills the screen.
A viewer test in the repo loads the page headless, drags it, saves screenshots and fails on any console error. Load time was 1.4 s, with zero errors.
Step 6: the camera move, MP4 and GIF
Prompt:
"Render a seamless 5 second camera loop from that viewer in headless Chrome, orbiting 6 degrees each way around the car itself: a 1280x720 MP4 at 30 fps and a looping GIF under 10 MB so it plays smoothly on GitHub and posts to X. Look at the frames at 0%, 25%, 50% and 75% and fix anything ugly: grey edges, holes, rubber-sheet smears."
Four frames from the loop are in the repo at assets/orbit_frames.jpg.
The video reuses the HTML viewer, so there is no second renderer that could disagree with the first. Playwright drives headless Chrome, a setView(t) function places the camera for each of 150 frames, and each frame is read back as a PNG and piped into an H.264 encoder. The path is a sine orbit of plus or minus 6 degrees around a pivot at 95% of the median scene depth, which lands on the car, a small vertical bob at twice the frequency, and a 4% push in. Every motion is a sine of the same loop time, so frame 150 lines up with frame 0 and the GIF loops without a jump. Checked: the pixel difference from the last frame to the first (17.8 on a 0 to 255 scale) matches that between neighbouring frames (17.7).
Rendering 150 frames took 74 to 79 s, about 0.5 s per frame in software WebGL. The GIF is built from the MP4 at half the frame rate, 560 px wide, with a 160 colour palette: 75 frames, 9.6 MB.
What the first render got wrong
The script started from an earlier pipeline tuned for landscape photos with no dominant subject. A car close to the camera broke three of its defaults.
Round 1, landscape defaults: the camera orbited a point at 55% of the median depth, which on this photo sits in front of the car, so the car swung sideways instead of turning in place. A 20% safety crop also cut off the bumper. Fix: pivot at 0.95 of the median depth, frame 97% of the photo, push in 4% instead of 8%.
Round 2, pivot on the car: at 25% of the loop a smeared olive band appeared beside the hood, and a grey strip showed at the left edge. The background layer used a square 27 cell minimum filter, far narrower than a car, so in the fill layer the car kept its own depth and its edge became a stretched, smeared sheet.
Round 3, wide and short filter: the occluder mask grew from 29.8% to 46.8% of the grid and now covered the whole car. The band was still there, because OpenCV's Telea inpainting fills a large hole with radial streaks of blended colour. Fix: replace inpainting with the row-by-row mirror described above.
Round 4, mirror fill: the strip beside the hood now shows grass texture, and doubling the fill texture to 1,600 px sharpened it. A 768 wide grid softened the stepped hood edge but grew the .glb to 25.4 MB and the viewer to 34.7 MB, so the repo stays at 512.
Round 5, viewer drag test at 14 degrees: the scene edge was visible. Fix: the fill layer now extends 20% past the photo, and the drag limit is 10 degrees. This is the version in the GIF.
The real numbers in one place
📷 Input: 1280x863 JPEG, CC0
⏱️ Depth: 12.0 s cold, 4.1 to 4.8 s warm, 8 CPU threads
🧊 Mesh: 341,944 front triangles after trimming 2.74%, plus 194,922 fill triangles, built in 0.6 to 0.8 s
🎬 Video: 150 frames at 1280x720 in 74 to 79 s on CPU
✅ Total for the one command: 87 s cold, 83 to 84 s warm
💸 Cost: $0, no API, no GPU
The repo
Repo: https://github.com/swiftverse/photo-to-3d-grokbot
I asked for one more thing: package it as a proper repo, clone it fresh, install from requirements.txt in a new virtual environment and run the one command again. The fresh install took 36 s with a warm pip cache, and the fresh run produced a .glb, MP4 and GIF byte-identical to the development run, so the pipeline is deterministic.
It is one Python script of about 330 lines, a viewer template, the bundled three.js and a viewer test. The README opens with the demo GIF, then the pipeline, the tested timings, every flag, the fixes above and the limitations. The repo is about 13 MB including the example photo and the GIF. The tested commands:
git clone https://github.com/swiftverse/photo-to-3d-grokbot.git
cd photo-to-3d-grokbot
python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python make_3d.py examples/car.jpg
The flags you will actually touch: --far for depth strength, --fov if the photo is a wide phone shot (try 70), --pivot to choose what the orbit turns around, --yaw for how far the video swings, --hole-width if your subject is wider than 80% of the frame, and --no-video if you only want the mesh and viewer. PROMPTS.md has every message I sent, including the three fix prompts.
The one-shot prompt
If you just want the result, this single message does it:
"Here is a photo of a car (or find a CC0 one). Make it 3D on your box: Depth Anything V2 Small depth map, textured mesh with edge trimming and a filled background layer, .glb export, a single-file three.js viewer I can drag around, a 5 second orbit MP4 and a GIF under 10 MB. Check the frames yourself, then give me the files and the timings for each step."
The important words are "check the frames yourself". The first render ran without errors and looked wrong; the result came from the loop of render, look, fix, render again.
What works and what does not
Car photos that work well: three-quarter front or rear shots with open space behind, cars on a road with a vanishing point, a car in a showroom with depth behind it, cars on grass or gravel, which mirror-fill cleanly.
Car photos that do badly: side profiles against a wall, top-down shots, night shots with blown-out headlights, cars in a tight row, and strongly patterned backgrounds like brick, where the mirrored fill shows as a copy.
Things that are genuinely hard:
Glass and chrome. The depth model treats reflections as surfaces, so the windscreen behaves like a painted panel with the interior printed on it. Look closely at the GIF on the repo page and you will see it.
Hidden surfaces and scale. The far side of the car does not exist, and depth is relative, so you cannot measure the car from this mesh.
Edges. Trimming leaves slightly stepped silhouettes at grid resolution, most visible along the hood line.
Web file size. 17.9 MB is heavy for a listing page. Draco or meshopt for the mesh and WebP or KTX2 for textures should cut it several times over; I have not measured that here.
How to expand on this
This demo is the cheapest point on a scale. Each step up gets more real 3D and costs more capture, compute or money.
Level 1: a better 2.5D scene
Swap the mirror fill for a learned inpainting model such as LaMa or a diffusion inpainter. The revealed strip would then contain plausible new grass or asphalt instead of a mirrored copy. Biggest visual gain for the least work.
Try a larger depth model. Depth Anything V2 Base and Large are sharper on edges, but those checkpoints use a non-commercial licence, while Small is Apache-2.0.
Segment the car onto its own layer with a segmentation model. Silhouettes get cleaner and the hood line stops stepping.
Level 2: cinematic renders in Blender
The .glb imports straight into Blender. Add a camera path with real easing, depth of field on the headlight and a light sweep across the paint, then render in EEVEE or Cycles. Blender runs headless, so Grok Bot can script this from a prompt too.
Level 3: many photos, real geometry (photogrammetry)
Walk around the car and take 30 to 200 overlapping photos, every spot visible in at least three. Photogrammetry reconstructs a true mesh at real proportions. COLMAP and Meshroom are free and open source; RealityScan from Epic is free for individuals and companies under $1 million in revenue. Cars are a hard case: glossy paint, glass and chrome confuse the tracking, so shoot on an overcast day and expect cleanup on the windows.
Level 4: phone video to photoreal 3D (Gaussian splatting)
A Gaussian splat represents a scene as millions of small coloured, semi-transparent blobs instead of triangles. Trained from a 1 to 3 minute phone video of a slow walk around the car, it can look photographic from any angle the video covered, including reflections that photogrammetry struggles with. Current tools:
📱 Scaniverse: trains on the phone itself, free tier available, exports PLY and SPZ
📱 Polycam: phone and web, splats on paid plans
🖥️ Postshot: Windows desktop with an NVIDIA GPU, a free non-commercial tier and paid tiers for export and commercial use
🧪 nerfstudio, gsplat, Brush, LichtFeld Studio: open source trainers if you want full control
Splats display in a browser with viewers such as SuperSplat or PlayCanvas. The hard parts are capture discipline (slow, steady, overlapping coverage, including low angles for the wheels), cleaning up floating blobs, and files that can reach hundreds of MB before compression.
Level 5: image-to-3D, a full 360 degree car from one photo
Generative image-to-3D models produce a complete 360 degree mesh from a single photo, inventing the side the camera never saw. Current ones include TRELLIS.2 (MIT code), Hunyuan3D 3.x, Tripo H3.1 and Meshy 7.1. API prices are well under a dollar per model: Tripo lists image-to-3D at $0.20 to $0.30 per model, Meshy at 20 to 30 credits, and hosted TRELLIS.2 at around $0.25 to $0.35. For a car this gives a spinnable model for a product page or mockup in minutes. The back half is invented, so it suits a concept or a marketing visual, not the listing of a specific used car, where a generated rear bumper could hide a real dent. These APIs need an account and credits, so Grok Bot should ask before spending.
Level 6: real streets at city scale
To put a car in its real surroundings, Google's Photorealistic 3D Tiles cover many of the world's populated areas with a textured 3D mesh. They load in CesiumJS, deck.gl or a three.js 3D Tiles renderer with a Google Maps Platform API key and billing, under strict attribution and caching terms.
Where this is useful for cars
🚗 Dealership and classified listings: a parallax hero shot made from the best listing photo, at zero cost per image, so it scales to a whole inventory. Every visible pixel is the real car, which matters for trust.
🛒 Product pages for accessories: wheels, roof boxes, seat covers and dash cams shown on a car photo that moves slightly as you scroll.
🔄 Full 360 spins: image-to-3D for a concept or a model car, photogrammetry or a splat from a phone walk-around when the spin has to show the actual vehicle.
📣 Ads and social posts: a 5 second loop stops the scroll better than a still and costs nothing extra to make.
🎞️ Car history videos and car clubs: archive or show photos of classic models turned into slow parallax moves, one photo each.
What each level costs
Level 1 (this demo): $0, under 90 seconds on a CPU, 2.5D only.
Level 2 (Blender): $0 in software, minutes to hours of render time depending on quality.
Level 3 (photogrammetry): $0 in software, 30 to 200 photos, a GPU strongly recommended, an evening for the first car.
Level 4 (splats): $0 on free tiers, roughly $17 to $50 a month for paid tiers with commercial use, a 1 to 3 minute video, cloud processing or a local NVIDIA GPU.
Level 5 (image-to-3D): roughly $0.20 to $0.80 per model through APIs, with an invented back side.
Level 6 (Google 3D Tiles): pay-as-you-go Maps Platform billing, real streets, strict terms.
Try it
Pick a three-quarter photo of a car with space behind it, send Grok Bot the one-shot prompt, and ask it to show you the frames before it hands you the GIF. Or clone the repo and run python make_3d.py on your own photo. A learned inpainter, a Blender pass or a phone walk-around takes it from a moving photo to a model.
Photo credit: "1975 AMC Pacer base model at 2012 Rockville e" by CZmarlin (Christopher Ziemnowicz), CC0, via Wikimedia Commons.
Sources
Repo for this project: https://github.com/swiftverse/photo-to-3d-grokbot
Photo: https://commons.wikimedia.org/wiki/File:1975_AMC_Pacer_base_model_at_2012_Rockville_e.jpg
CC0 1.0 public domain dedication: https://creativecommons.org/publicdomain/zero/1.0/
Depth Anything V2 Small model card: https://huggingface.co/depth-anything/Depth-Anything-V2-Small-hf
three.js: https://github.com/mrdoob/three.js
Playwright for Python: https://playwright.dev/python/
COLMAP: https://colmap.github.io/
Meshroom: https://alicevision.org/#meshroom
Gaussian splatting tools overview: https://developer.playcanvas.com/user-manual/gaussian-splatting/creating/recommended-tools/
Video to splat tools compared: https://splattour.com/en/blog/video-to-gaussian-splatting-online
Tripo API pricing: https://developers.tripo3d.ai/en/pricing
Meshy API pricing: https://docs.meshy.ai/en/api/pricing
3D generation API comparison: https://www.sloyd.ai/blog/best-3d-model-generation-apis
Google Photorealistic 3D Tiles: https://developers.google.com/maps/documentation/tile/3d-tiles
Source: Amit Shrivastava · x.com