GLUUNPROJECT(3G)
π GLUUNPROJECT(3G) π
okay bestie, welcome to the gluUnProject page β it's in the 3G manual section (that's the GLU utility library zone, iykyk) and it's literally about turning your screen coords back into 3D world coords. we're doing reverse math today and it's giving main character energy β¨
β¨ NAME β¨
gluUnProject β map window coordinates to object coordinates π¦
like, you give it where something is on the screen, and it tells you where that actually is in your 3D scene. the un-do button for projection, fr fr.
πΈ C SPECIFICATION πΈ
GLint gluUnProject( GLdouble winX,
GLdouble winY,
GLdouble winZ,
const GLdouble *model,
const GLdouble *proj,
const GLint *view,
GLdouble* objX,
GLdouble* objY,
GLdouble* objZ )
copy it exactly, bestie, every GLdouble and * matters π
π PARAMETERS π
winX,winY,winZβ the window coordinates you wanna map. yes, all three, we're being thorough.modelβ the modelview matrix. you'd grab this from aglGetDoublevcall, no cap.projβ the projection matrix. also aglGetDoublevsituation.viewβ the viewport. this one comes from aglGetIntegervcall, okurrr.objX,objY,objZβ not inputs, bestie, these are the returns. the computed object coordinates land here. π«Ά
π DESCRIPTION π
so gluUnProject maps the specified window coordinates into object coordinates using model, proj, and view. the result gets stored in objX, objY, and objZ.
and listen β the return value is doing a whole vibe check:
- return
GL_TRUE= success, we ate π - return
GL_FALSE= failure, it's giving flop π
to compute the coordinates (objX, objY, and objZ), gluUnProject multiplies the normalized device coordinates by the inverse of model*proj as follows:
objX
βobjYβ =INV(PM)β_______________β1β
objZ _______________β1
W 2(winZ)β1
(that's the formula, transcribed faithfully, go off king)
INV()denotes matrix inversion. that's it, that's the whole notation.Wis an unused variable, included for consistent matrix notation. it does nothing, it's just there for the aesthetic π
heads up: W is literally unused. don't go looking for meaning in it. it's decorative. like a bow. π
π SEE ALSO π
glGet(3G)gluProject(3G)
and that's the whole page, bestie β GLUUNPROJECT(3G) in the 3G manual, same title front and back because symmetry is iconic. go un-project something gorgeous. periodt. πβ¨π¦
π¦ 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