I'm trying to create an orthographic projection using GLM for rendering UI elements. I have a window that's 1280x720 and I'm creating the projection like so:
float aspect = (float) height / (float) width;
// args: left, right, bottom, top, ...
glm::mat4 projection = glm::ortho(-1.0, 1.0, -aspect, aspect , near, far); // near: -2.0, far: 2.0If I create square mesh like this:
auto geometry = Geometry::Primitive::Plane(1.0f, 1.0f * aspect); // (width, height)Then the square would look too wide, UNLESS I do this:
auto geometry = Geometry::Primitive::Plane(1.0f * aspect, 1.0f * aspect …