Javier Castellar (javier++at++sixty.asd.sgi.com)
Thu, 6 Jun 1996 13:47:52 -0700
We already have this support on the OpenGL Utility lib.
FROM THE OPENGL REFERENCE MANUAL (it is online)
--------------------------------
Convert object coordinates to screen 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);
int gluUnProject (GLdouble winx, GLdouble winy, GLdouble winz, const
GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint
viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz);
FROM THE MAN PAGES
------------------
gluProject(3G) OpenGL Reference gluProject(3G)
NAME
gluProject - map object coordinates to window coordinates
C SPECIFICATION
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 )
PARAMETERS
objx, objy, objz
Specify the object coordinates.
modelMatrix Specifies the current modelview matrix (as from a
glGetDoublev call).
projMatrix Specifies the current projection matrix (as from a
glGetDoublev call).
viewport Specifies the current viewport (as from a glGetIntegerv
call).
winx, winy, winz
Return the computed window coordinates.
DESCRIPTION
gluProject 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.
SEE ALSO
glGet, gluUnProject
-----------------------------------------------------------------------------
gluUnProject(3G) OpenGL Reference gluUnProject(3G)
NAME
gluUnProject - map window coordinates to object coordinates
C SPECIFICATION
int gluUnProject( GLdouble winx,
GLdouble winy,
GLdouble winz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *objx,
GLdouble *objy,
GLdouble *objz )
PARAMETERS
winx, winy, winz
Specify the window coordinates to be mapped.
modelMatrix Specifies the modelview matrix (as from a glGetDoublev
call).
projMatrix 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.
DESCRIPTION
gluUnProject maps the specified window coordinates into object
coordinates using modelMatrix, projMatrix, and viewport. The result is
stored in objx, objy, and objz. A return value of GL_TRUE indicates
success, and GL_FALSE indicates failure.
SEE ALSO
glGet, gluProject
-- ************************************************************************* * Javier Castellar Arribas * Email: javier++at++asd.sgi.com * * * Vmail: 3-1589 * * Member of Technical Staff * Phone: (415)-933-1589 | 933-2108 (lab) * * Applied Engineering * Fax: (415)-964-8671 * * Advanced Systems Division * MailStop: 8L-800 * ************************************************************************* * Silicon Graphics Inc. * * 2011 N. Shoreline Boulevard, * * Mountain View, California 94043-1386, USA * ************************************************************************* "Violence is the last refuge of the incompetent" Hari Seldon======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:59 PDT