I have a spritesheet that consist of seven 50x37 pixel frames. I'm rendering the image onto a 1x1 unit quad. This is one of the frames outside of my engine:
Everything is animating correctly but he looks thinner in my engine:
In order for my character to look the right proportions: I have to instantiate the quad mesh wider...since each frame is greater in width (50x37).
const model = Model.IndexedQuad(1.3, 1);
Only then everything looks great, still I eyeballed that 1.3 value.
My questions:
1) Does this mean I have to make a quad for every sprite that has different dimensions? For example, if I have four 50x20 characters, and three 20x30 characters: I'd need two quads for those different sizes?
Or should I use one 1x1 quad for all sprites and scale its transform relative to the frame size afterwards? Not sure how to do this though. It's easier for me to instantiate a mesh for different sizes, but doesn't that mean binding more meshes?
2) Again, I'm eyeballing the size of the quad, but is there a way I can calculate the right size of the quad in normalized units? Considering that my character is 50x37 (in pixels). Maybe dividing width/height.
Oh and almost forgot to mention, I'm rendering each frame by passing a texture matrix to my shader. I'm not altering the uvs on the mesh.
Thank you very much for reading, hope I made sense!