GLUPROJECT(3G)
π GLUPROJECT π
okay so bestie, welcome to the 3G manual, and the page we're on rn is literally called GLUPROJECT. it's the glow-up machine that takes your cute little object coordinates and yeets them into window coordinates. no cap, this one is a whole vibe. π¦
β¨ NAME β¨
gluProject β map object coordinates to window coordinates π
π C SPECIFICATION π
here's the signature, copy it exactly bestie, don't freestyle:
GLint gluProject( GLdouble objX,
GLdouble objY,
GLdouble objZ,
const GLdouble *model,
const GLdouble *proj,
const GLint *view,
GLdouble* winX,
GLdouble* winY,
GLdouble* winZ )
and also, sitting right there in the original, this lil line:
delim $$
πΈ PARAMETERS πΈ
objX,objY,objZβ the object coordinates you're sending in. the raw material, the pre-glow-up era.modelβ the current modelview matrix, as in the one you'd get from aglGetDoublevcall.projβ the current projection matrix, also as from aglGetDoublevcall.viewβ the current viewport, as from aglGetIntegervcall.winX,winY,winZβ these are the outputs, they return the computed window coordinates. they don't come in, they come OUT. main character energy fr.
π¦ DESCRIPTION π¦
okay so here's the tea. gluProject transforms the specified object coordinates into window coordinates using model, proj, and view. the result gets stored in winX, winY, and winZ. and the return value? a return value of GL_TRUE indicates success, and a return value of GL_FALSE indicates failure. periodt. β¨
so how does it compute the coordinates, you ask? let
$v ~=~ ("objX", "objY", "objZ", 1.0)$
represented as a matrix with 4 rows and 1 column. (yes bestie, a column vector, we love a tall skinny icon.) then gluProject computes $v sup prime$ as follows:
v sup prime ~=~ P ~times~ M ~times~ v
where $P$ is the current projection matrix proj, $M$ is the current modelview matrix model (both represented as $4 times 4$ matrices in column-major order) and '$times$' represents matrix multiplication. matrix math is literally just vibes in a grid, iykyk.
the window coordinates are then computed as follows:
"winX" ~=~ "view" (0) ~+~ "view" (2) ~*~ (v sup prime (0) ~+~ 1)~/~2
"winY" ~=~ "view" (1) ~+~ "view" (3)~*~(v sup prime (1) ~+~ 1)~/~2
"winZ" ~=~ (v sup prime (2) ~+~ 1)~/~ 2
β οΈ friendly reminder: those three lines are the actual formulas, so keep the view indices exactly as written. do not be cute with the math. π«Ά
π SEE ALSO π
glGet(3G)gluUnProject(3G)
and that's the whole page, bestie!! it's giving computational geometry but make it slay. π
this one's from the GLUPROJECT(3G) page β so yeah, that title shows up at the top and again at the bottom as the footer, and that's literally all the footer says. bye pookie, go project something gorgeous β¨ππ¦π
π¦ 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