GLLOADMATRIX(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

πŸ’– GLLOADMATRIX πŸ’–

okay bestie, welcome to the GLLOADMATRIX(3G) page β€” yes that's the manual section, we're in the 3G girlies (OpenGL girlies, obviously) πŸ’…


✨ NAME ✨

glLoadMatrixd, glLoadMatrixf β€” swap out the current matrix for the one you hand over, no cap πŸ”„


🌸 C SPECIFICATION 🌸

void glLoadMatrixd( const GLdouble *m )
void glLoadMatrixf( const GLfloat *m )

πŸŽ€ PARAMETERS πŸŽ€

  • m β€” a pointer to 16 consecutive values, periodt. Those 16 lil guys get used as the elements of a 4Γ—4 column-major matrix. sixteen. not 15, not 17. sixteen 🫢

πŸ’« DESCRIPTION πŸ’«

glLoadMatrix replaces the current matrix with the one whose elements are specified by m. and which matrix is "the current matrix" bestie?? it's the projection matrix, the modelview matrix, or the texture matrix β€” depends on your current matrix mode (go check glMatrixMode, she knows) πŸ‘‘

The current matrix, M, defines a transformation of coordinates. For instance β€” assume M refers to the modelview matrix. If v=(v[0],v[1],v[2],v[3]) is the set of object coordinates of a vertex, and m points to an array of 16 single- or double-precision floating-point values m[0],m[1],...,m[15], then the modelview transformation M(v) does the following:

                               m[0] m[4] m[8]  m[12]   v[0]
                         M(v)=⎝m[1] m[5] m[9]  m[13]βŽ Γ—βŽv[1]⎠
                               m[2] m[6] m[10] m[14]   v[2]
                               m[3] m[7] m[11] m[15]   v[3]

Where Γ— denotes matrix multiplication. (yes the math girlies ate with this one 😭)

Projection and texture transformations are similarly defined. same energy, different matrix ✨


πŸ¦‹ NOTES πŸ¦‹

so like β€” even though you can specify the elements of the matrix with single or double precision, the GL implementation may store or operate on these values in less than single precision. it's giving "we heard you, we just didn't fully listen" πŸ™ˆ


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION is generated if glLoadMatrix is executed between the execution of glBegin and the corresponding execution of glEnd.
🚨 bestie NO. do not do this. do not call glLoadMatrix inside a glBegin/glEnd block. the GL will literally yell at you. wait for your glEnd like a civilized icon πŸ’…

πŸ‘‘ ASSOCIATED GETS πŸ‘‘

  • glGet with argument GL_MATRIX_MODE
  • glGet with argument GL_COLOR_MATRIX
  • glGet with argument GL_MODELVIEW_MATRIX
  • glGet with argument GL_PROJECTION_MATRIX
  • glGet with argument GL_TEXTURE_MATRIX

🌈 SEE ALSO 🌈

  • glLoadIdentity(3G)
  • glMatrixMode(3G)
  • glMultMatrix(3G)
  • glPushMatrix(3G)

and that's the whole page, bestie!! πŸŽ€ go forth and load those matrices, you absolute main character 🫢

this has been GLLOADMATRIX(3G) β€” the 3G manual page β€” signing off πŸ’–βœ¨

πŸ“¦ where this page comes from