tommyettinger / IsoVoxel

Generates isometric pixel art from MagicaVoxel .vox files
MIT License
343 stars 25 forks source link

How many angles for camera setup? #10

Closed superfrantv closed 4 years ago

superfrantv commented 4 years ago

Hello,

last question, how much degrees you setup for the orthographic camera? i think if i export a iso-Sprite with the newest Magica Voxel and export a iso-Sprite from IsoVoxel there are different angles.

tommyettinger commented 4 years ago

IsoVoxel generates a few different angles, but it doesn't use a camera internally. It places sprites that are shaded like cubes at screen positions based on pretty simple formulas, though these formulas are different for a head-on view (model turned 0 degrees or 90 degrees, for example) vs. an isometric view (model turned 45 degrees or 135 degrees, for example). If you want clean 2x1 grid lines for isometric views, the correct camera angle is apparently 26.565 degrees, more info here. These lines won't stay clean if you rotate the model to a different facing, or if any lines aren't parallel to grid lines (those will potentially have some jagged shape; using voxels in the source models, instead of 3D models, helps to avoid this). I believe my head-on views have a subtly incorrect "camera angle" (at least, it is different from the isometric views), so I wouldn't try to copy the angle used by IsoVoxel for head-on, and I'd use the same 26.565 degree angle everywhere. IsoVoxel and MagicaVoxel's iso-Sprite renders also may use different cube sizes for the voxels, which can affect the angle they appear to use. IsoVoxel uses different cube sizes, somewhat, for head-on and isometric renders, because the cube size is really just the size of the rectangular sprite it places (isometric shows up as wider because a rotated cube is wider on-screen).

There's some possibly useful information here about how to add pixel-art-like outlines to a 3D model, it seems a little complex but produces a nice quality. There are probably easier ways to add outlines in specific cases, like when outlines are always black.

I hope his helps!