I have yet to see anyone answer this question yet. All I see is people telling them something is upside down and then someone else tells them to flip their code. But what I'm wondering is why does OpenGL flip the Y coords? It makes no sense.
OpenGL assumes Y coordinates going from bottom to top. If your code assumes the opposite will display things upside down.
For more information Google for opengl coordinate system
It all depends on how you setup your scene. There are many things that can cause this effect.
For instance, the camera position/orientation affects how you see the final scene.
gluLookAt(camera[0], camera[1], camera[2], /* look from camera XYZ */
0, 0, 0, /* look at the origin */
0, 1, 0); /* positive Y up vector */
When working with textures, specifying wrong texture coordinates can flip the drawing.
But the most common issue might be people forgetting that OpenGL defines coordinate (0, 0) to be the lower left corner of the display (with the Y going upward).
OpenGL works on Cartesian coordinates. In a Cartesian coordinate system 0,0 is in the center, with positive coords extending up and to the right. Any coordinates can be mapped or transformed to whatever the programmer wishes, but this is the default. When you give texture coordinates OpenGL expects those to be Catresian coordinates, not top down coordinates. Those coordinates can be transformed by the program, but the quickest fix is to just flip the texture.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With