The gluProject function maps object coordinates to window coordinates.

int gluProject(
  GLdouble objx,  GLdouble objy,  GLdouble objz,  const GLdouble modelMatrix[16],  const GLdouble projMatrix[16],  const GLint viewport[4],  GLdouble *winx,  GLdouble *winy,  GLdouble *winz);


  • objx, objy, objz
    The object coordinates.
  • modelMatrix
    The current modelview matrix (as from a glGetDoublev call).
  • projMatrix
    The current projection matrix (as from a glGetDoublev call).
  • viewport
    The current viewport (as from a glGetIntegerv call).
  • winx, winy, winz
    The computed window coordinates.


The gluProject function transforms the specified object coordinates into window coordinates using modelMatrix, projMatrix, and viewport. The result is stored in winx, winy, and winz. A return value of GL_TRUE indicates success, and GL_FALSE indicates failure.


**  Windows NT/2000:** Requires Windows NT 3.5 or later.
**  Windows 95/98:** Requires Windows 95 or later. Available as a redistributable for Windows 95.
**  Header:** Declared in Glu.h.
**  Library:** Use Glu32.lib.

See Also

glGetDoublev, glGetIntegerv, gluUnProject