-
I'm new to graphics programming, also I don't know much about fonts. So my question is pretty basic, but I'm still having a hard time wrapping my head around it. I noticed that stbtt_GetBakedQuad returns a quad with a top left coordinate system where most OpenGL examples are bottom-up. Is there are reason for it, or is just purely a design choice. And also I would like to know in greater detail how to inverse the Y coordinate in the quad so it could be applied to a bottom- up orthographic projection. Or is there no other way around it and I have to use top-bottom ortho projection? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To the first, almost everything about texture coordinates is arbitrary interpretation and convention, as the meaning of 0..1 remains the same regardless of whether you think of 0..1 as bottom-to-top or top-to-bottom. The top-to-bottom convention is typical for image maps, so I tend to use the top-to-bottom convention for everything else for consistency. (The place in OpenGL where it's visible, where it's not arbitrary, is how a texture is filled when you render to a render target.) To the second, you should just be able to negate the Y offset when using a bottom-to-top projection. |
Beta Was this translation helpful? Give feedback.
To the first, almost everything about texture coordinates is arbitrary interpretation and convention, as the meaning of 0..1 remains the same regardless of whether you think of 0..1 as bottom-to-top or top-to-bottom. The top-to-bottom convention is typical for image maps, so I tend to use the top-to-bottom convention for everything else for consistency. (The place in OpenGL where it's visible, where it's not arbitrary, is how a texture is filled when you render to a render target.)
To the second, you should just be able to negate the Y offset when using a bottom-to-top projection.