How do you go about flipping the coordinate system in OGL. Let’s say I want to draw an image at the top of the screen and then flip the coordinates and draw with the exact same command again but this time the image is upside down and at the bottom of the screen. Basically a simple way to draw a mirror image.
well thats easy in opengl, you just flip the quad that you are drawing the image on, since your image will probably be on a quad, you just draw it the other way round, or you could use glRotate to rotate it round the axis to get the back of it!
Yeah I thought about that but I’m using a 2d library on top of OGL. So I don’t have access to the quad. I thought I might be able to just do something with the view or projection matrixes. hmm, thanks.
Flip the projection matrix. If you’re in ortho mode, then flip the down and up params. If you’re in 3D, then it’s a bit more complicated, but doing the math should help you a lot.
You can do the trick on the texture matrix, or yet on the modelview matrix, too. The 180° rotation proposed is a good idea, but a negative scale works too.
SeskaPeel.
Thanks.
why dont you scale by -1 in the y direction? :