Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: Updating projection matrix after changing viewport aspect ratio

Threaded View

  1. #1
    Newbie Newbie
    Join Date
    May 2014
    Posts
    1

    Updating projection matrix after changing viewport aspect ratio

    EDIT: Fixed it myself, the image WAS distorted in the first place, it was just hard to recognize by the displayed part of the scene

    Hey,

    I am using GLFW to handle my window together with OpenGL 2.1 and GLSL 1.2 as well as GLM.
    My window has an aspect ratio of 4:3. I use an orthographic projection of the form
    Code :
    glm::ortho(-1,+1,-1,1+,0.1,100)
    , which displays my scene undistorted (part of the scene at the bottom/top is clipped though).
    However i seem not to understand the interaction between an orthographic projection and my viewport aspect ratio. If i resize my window (to a different aspect ratio) my scene is distorted when using the same orthographic projection as before. If i scale the left/right and bottom/top arguments of my ortho according to the new aspec ratio however, my scene is displayed correctly. Why do i have to rescale it or why didnt i have to scale it in the first place?

    Best,
    Max
    Last edited by madmax1; 06-03-2014 at 12:48 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •