How it works
A sprite drawn slanted is one view of a thing: every pixel is a ray through it, and a thing anywhere along that ray would draw the same. sprite2model guesses the depth from what such things usually are, and carves voxels one sprite pixel wide:
- Box and Round: the thing stands at its tile's centre and is the same mirrored east to west and north to south. Its mirrored copies (the thing seen from the other diagonals) must all fall on the silhouette, which carves a visual hull; each level is then a box or a circle as wide as the hull reaches along the diagonals, and the overhang the hull leaves on flat tops is peeled off.
- Wall: it runs the length of its tile, the same all along: walls, fences, corners.
- Cut-out: it is one-sided (a statue, a banner), stood up facing you and given a rounded body behind.
- Outfit sheet: a creature drawn facing north, east, south and west, one column each, all from the same eye: the four columns are four real views, and the model is carved where all four see it.
- Auto tries them about a few possible centres and keeps the one that explains most of the sprite.
Faces the sprite shows take its pixels' colours; hidden ones those of the same face mirrored, or of the front at the other end of their row. The faces of each plane are merged into rectangles and their texels packed into one texture, drawn with nearest filtering: a crisp, low-poly model (a pillar is 92 triangles), one tile one unit, standing on its origin.
On your computer
Download sprite2model from the releases (or go install github.com/Coldensjo/sprite2model/cmd/sprite2model@latest), then:
sprite2model -preview pillar.png # writes pillar.glb and pillar.preview.png sprite2model -reading round -out models *.png sprite2model serve # this page, run locally
The page converts in your browser (Go compiled to WebAssembly): your sprites never leave your computer.