What matrix to flip vertically?

Started by
1 comment, last by leiavoia 19 years, 4 months ago
Pardon my OpenGL ignorance. I looked up chapter 3 in the Redbook and did a forum search but am not finding the answer to a simple question: If i have a 2D game in ortho mode, and it currently displays like this: and i want to flip it vertically like this: what matrix do i need to multiply it by? Or can i do that? The redbook didn't have them labeled (or i missed it) and matrices don't jive with my thought process well. Bonus points if you can explain why it works. Thanks for your help. I need it!
Advertisement
Try a glScalef(1, -1, 1) on the orthographic projection matrix, that should do the trick (at least, if you're using symmetric coordinates). This will relocate the origin for every render operation you'll do. If you just want to do it for a set of primitives, flip the model view matrix.
hey, that was simple enough. Thanks! I'm trying to write a wrapper that flips output text from FTGL without hacking FTGL to suit my needs. I think that's going a bit too far.

Thanks again.

This topic is closed to new replies.

Advertisement