[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

gluUnProject Subroutine


Projects world space coordinates to object space.


OpenGL C bindings library: libGL.a

C Syntax

int gluUnProject(GLdouble WindowX, 
   GLdouble WindowY, 
   GLdouble WindowZ, 
   const GLdouble ModelMatrix[16], 
   const GLdouble ProjectMatrix[16], 
   const GLint Viewport[4], 
   GLdouble *ObjX, 
   GLdouble *ObjY, 
   GLdouble *ObjZ)


The gluUnProject subroutine maps the specified window coordinates into object space coordinates using the ModelMatrix, ProjectMatrix, and Viewport parameter values provided. Results are stored in ObjX, ObjY, and ObjZ. A return value of GL_TRUE indicates success, and GL_FALSE indicates failure.


WindowX, WindowY, WindowZ Specify the window coordinates to be mapped.
ModelMatrix Specifies the modelview matrix (as from a glGetDoublev call).
ProjectMatrix Specifies the projection matrix (as from a glGetDoublev call).
Viewport Specifies the viewport (as from a glGetIntegerv call).
ObjX, ObjY, ObjZ Returns the computed object coordinates.

Return Values

GL_TRUE Indicates the projection succeeded.
GL_FALSE Indicates the projection failed.


/usr/include/GL/gl.h Contains C language constraints, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glGet subroutine, gluProject subroutine.

OpenGL Overview.

[ Previous | Next | Contents | Glossary | Home | Search ]