Advertisement

glOrtho matrix value at [3][3] ( solved! )

Started by June 24, 2019 05:23 PM
1 comment, last by JohnnyCode 5 years, 7 months ago

Here's the code I use:

glLoadIdentity()
glOrtho(-1,1,-1,1,0.01,100.0)
print(glGetFloatv(GL_PROJECTION_MATRIX))

Here is the output:

[[ 1.          0.          0.          0.        ]
 [ 0.          1.          0.          0.        ]
 [-0.         -0.         -0.020002   -0.        ]
 [ 0.          0.         -1.00020003  1.        ]]

Where does the value for [3][2] come from, when https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml explains the value should be 0?

image.png.2a590830afb940a1e1bfe87b3eaaab8b.png

You mean -1.00020003 value, that'd be [4,3] value, it is the actual tz value, you are seeing the transposed version of the matrix in the output spectation

.

Advertisement

This topic is closed to new replies.

Advertisement