Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpenGlWidget and QMatrix4x4: how to invert the Y axis?
Qt 6.12 LTS is out! See what's new in the release blog

QOpenGlWidget and QMatrix4x4: how to invert the Y axis?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 953 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Violet Giraffe
    wrote on last edited by Violet Giraffe
    #1

    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.

    kshegunovK 1 Reply Last reply
    0
    • V Violet Giraffe

      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.

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2
      1,  0,  0,  0
      0, -1,  0,  0
      0,  0,  1,  0
      0,  0,  0,  1
      

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      4

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved