QOpenGlWidget and QMatrix4x4: how to invert the Y axis?



  • I have a QOpenGlWidget. The matrix my shader uses is QMatrix4x4().ortho(rect()). This results in the Y axis being directed from top to bottom, which is familiar, but I need the opposite Y axis direction as is customary in OpenGL. My understanding is I need to multiply the ortho matrix by an appropriate transformation matrix, but how to compose this matrix?

    rotate(180.0f, 0.0f, 1.0f, 0.0f) doesn't work, I get no visible image at all with it.


  • Qt Champions 2016

    1,  0,  0,  0
    0, -1,  0,  0
    0,  0,  1,  0
    0,  0,  0,  1
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.