GLUUNPROJECT4(3G)
β¨ NAME β¨
okay bestie, welcome to the 3G manual page for gluUnProject4 π β the icon that maps window and clip coordinates to object coordinates. no cap, thatβs the whole name-vibe: map window and clip coordinates to object coordinates. periodt. π
π C SPECIFICATION π
hereβs the signature exactly, character for character, because we do not play with prototypes, fr fr:
GLint gluUnProject4( GLdouble winX,
GLdouble winY,
GLdouble winZ,
GLdouble clipW,
const GLdouble *model,
const GLdouble *proj,
const GLint *view,
GLdouble near,
GLdouble far,
GLdouble* objX,
GLdouble* objY,
GLdouble* objZ,
GLdouble* objW )
π PARAMETERS π
winX,winY,winZβ specify the window coordinates to be mapped. window coords, bestie, the ones you wanna map. πͺβ¨clipWβ specify the clip w coordinate to be mapped. yes, the w. we love a w. πmodelβ specifies the modelview matrix (as from aglGetDoublevcall). modelview tea βprojβ specifies the projection matrix (as from aglGetDoublevcall). projection tea βviewβ specifies the viewport (as from aglGetIntegervcall). viewport tea βnear,farβ specify the near and far planes (as from aglGetDoublevcall). near/far planes, iconic. πobjX,objY,objZ,objWβ returns the computed object coordinates. the outputs, the main characters, the returns. π
πΈ DESCRIPTION πΈ
okay so gluUnProject4 maps the specified window coordinates winX, winY and winZ and its clip w coordinate clipW into object coordinates (objX, objY, objZ, objW) using model, proj and view. literally the reverse-glow-up pipeline. π
clipW can be other than 1 as for vertices in glFeedbackBuffer when data type GL_4D_COLOR_TEXTURE is returned. not me being flexible with w, but yes. This also handles the case where the near and far planes are different from the default, 0 and 1, respectively. so if your near/far are not the default 0 and 1, it still eats. π
A return value of GL_TRUE indicates success; a return value of GL_FALSE indicates failure. so check that vibe check, bestie β success vs failure, no in-between. π
To compute the coordinates (objX, objY, objZ and objW), gluUnProject4 multiplies the normalized device coordinates by the inverse of model*proj as follows:
objX
βobjYβ =INV(PM)β_______________β1β
objZ _______________β1
objW ____________β1
clipW
INV() denotes matrix inversion. the math is mathing, periodt. π₯
gluUnProject4 is equivalent to gluUnProject when clipW is 1, near is 0 and far is 1. so if those are your settings, itβs giving same energy as gluUnProject. π
π NOTES π
gluUnProject4 is available only if the GLU version is 1.3 or greater. no old-GLU crumbs, bestie β 1.3+ or nothing. π
π¦ SEE ALSO π¦
glGet(3G)glFeedbackBuffer(3G)gluProject(3G)gluUnProject(3G)
bye bestie π thatβs the whole gluUnProject4 moment from the 3G manual. the footer is just the manual tag β no extra source/version/date tea on this one β so consider this your cute sign-off. mwah πβ¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- fedora 43: gl-manpages 1.1-34.20190306.fc43 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- fedora 44: gl-manpages 1.1-35.20190306.fc44 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms