[Qt-interest] HelloGL: Q's surfaces are inverted?

Constantin Makshin cmakshin at gmail.com
Mon Nov 16 17:46:24 CET 2009


I guess that was made to invert the direction of the Y axis, because in  
OpenGL it's directed upwards while in 2D graphics it's more common to use  
the Y axis going downwards.

On Mon, 16 Nov 2009 19:35:45 +0300, Rui Maciel <rui.maciel at gmail.com>  
wrote:
> While fooling around with the HelloGL example[1] from Qt's examples site  
> I've stumbled on what appears to be
> a problem in the demo program. Although it compiles and runs perfectly  
> as expected, the orthographic
> projection is set as:
>
> glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);
>
> ...while glOrtho()'s parameters[2] are (left, right, bottom, top), which  
> means that every primitive will be
> rendered in an inverted position. Yet, when the parameters passed to  
> glOrtho() are straightened out the Q's
> primitives appear facing the other way, which means that, with backface  
> culling enabled, the only faces which
> will be rendered are those which should be hidden.
>
> Is this some sort of bug or am I missing something?
>
>
> Rui Maciel
>
> [1]http://doc.trolltech.com/4.5/opengl-hellogl.html
> [2]http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml

-- 
Constantin Makshin



More information about the Qt-interest-old mailing list