What !@##ing angle are these assets
So you have a bunch of "isometric" assets and they didn't come with a precise spec sheet. What's their math?
maybe you need to figure out their geometry to tile them gaplessly in e.g. unity such as Kenney's isometric blocks (as I was trying).
maybe you want to billboard them in a world of true-3d assets, so you'll have a camera which "undoes" the transformation that created them. That would result in the camera staring at the sprite straight-on (pixel-perfect-baybee) while embedding them in a geometrically orthogonal world (consider the legend of zelda lean). As I also was trying.
A common, semi-ideal unity-style rotation would be (30°, 45°, 0°) (remember to adjust positions to make that work -- (-10, +10, -10) for instance?). This assumes a few things:
you're laying things out unity style, which is confusing, because it uses xz as the ground plane -- remember, Vector2 "xy" vectors will need to be swizzled so that vector2.y<-->vector3.z!
You're drawing videogame isometric, where the 30° rotation lets you draw graphics where the edges slope exactly 2:1, for ease of drawing & fitting the crispy corners.
Kenney, bless his open-sourcing heart, did not pick these numbers. Nor (afaict?) did he document the numbers he did pick. But we are not lost yet!
Each asset is 111x128px; since they're drawn cubes (not diamonds), you only want to do the math on the apparent top face. Luckily, the bottom corner of the top face is the mathematical center of the asset, so we know that the top face is 64px tall, which means its height-over-width is a suspicious 0.5765-- very close to 1/√3 (0.5773) when you consider the pixels had to be integers!
sin⁻¹(1/√3) is our old friend 35.264° -- this is a true isometric projection!
Ok hotshot, how about the resolution of the images? I've set up a camera at rot (35.264, 45, 0) offset (-10, +10, -10); I've set up a cube at 0,0,0 (no rotation!), and a sprite inside of that cube at (54.735, 45, 0) (remember we want 90-camera rotation here, since we're "lying down from vertical", not rising up from horizontal). But it's the wrong size; these assets aren't 111 pixels per unit! Waah!
Correct: they are 111*tan(35.264)=~78.4889 pixels per unit. duh.
One last fun math fact. Could I/should I just lean the sprite such that its topmost pixel (a drawing of a corner of a cube) and bottommost pixel (a drawing of a corner of a cube) lined up with the actual 3d top & bottom corners? What's the angle of that? why isn't it just 35.264 again, arcsin(1/√3)! Magical.










