unproject.3gl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. '\" e
  2. '\"! eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 6 March 1997
  6. .ds Re Release 1.2.0
  7. .ds Dp May 02 11:53
  8. .ds Dm 37 unproject
  9. .ds Xs 63442 4 unproject.gl
  10. .TH GLUUNPROJECT 3G
  11. .SH NAME
  12. .B "gluUnProject
  13. \- map window coordinates to object coordinates
  14. .SH C SPECIFICATION
  15. GLint \f3gluUnProject\fP(
  16. GLdouble \fIwinX\fP,
  17. .nf
  18. .ta \w'\f3GLint \fPgluUnProject( 'u
  19. GLdouble \fIwinY\fP,
  20. GLdouble \fIwinZ\fP,
  21. const GLdouble \fI*model\fP,
  22. const GLdouble \fI*proj\fP,
  23. const GLint \fI*view\fP,
  24. GLdouble* \fIobjX\fP,
  25. GLdouble* \fIobjY\fP,
  26. GLdouble* \fIobjZ\fP )
  27. .fi
  28. .EQ
  29. delim $$
  30. .EN
  31. .SH PARAMETERS
  32. .TP \w'\f2winX\fP\ \f2winY\fP\ \f2winZ\fP\ \ 'u
  33. \f2winX\fP, \f2winY\fP, \f2winZ\fP
  34. Specify the window coordinates to be mapped.
  35. .TP
  36. \f2model\fP
  37. Specifies the modelview matrix (as from a \f3glGetDoublev\fP call).
  38. .TP
  39. \f2proj\fP
  40. Specifies the projection matrix (as from a \f3glGetDoublev\fP call).
  41. .TP
  42. \f2view\fP
  43. Specifies the viewport (as from a \f3glGetIntegerv\fP call).
  44. .TP
  45. \f2objX\fP, \f2objY\fP, \f2objZ\fP
  46. Returns the computed object coordinates.
  47. .SH DESCRIPTION
  48. \%\f3gluUnProject\fP maps the specified window coordinates into object
  49. coordinates using \f2model\fP, \f2proj\fP, and \f2view\fP.
  50. The result is stored in \f2objX\fP, \f2objY\fP, and \f2objZ\fP. A return value of
  51. \%\f3GL_TRUE\fP indicates success; a return value of \%\f3GL_FALSE\fP
  52. indicates failure.
  53. .P
  54. To compute the coordinates (\f2objX\fP, \f2objY\fP, and \f2objZ\fP),
  55. \%\f3gluUnProject\fP multiplies the normalized device coordinates by the inverse of
  56. \f2model\fP*\f2proj\fP as follows:
  57. .P
  58. .ce
  59. .EQ
  60. left ( down 70 {cpile { ~"objX" above ~"objY" above ~"objZ"
  61. above ~W}} ~~ right ) ~=~ INV(P M)
  62. left ( down 140 {cpile {
  63. { {2("winX" ~-~ "view"[0])} over {"view" [2]} ~-~ 1 }
  64. above
  65. { {2("winY" ~-~ "view"[1])} over {"view"[3]} ~-~ 1 }
  66. above
  67. { 2("winZ") ~-~ 1 }
  68. above
  69. 1}} ~~ right )
  70. .EN
  71. .bp
  72. $INV()$ denotes matrix inversion.
  73. W is an unused variable, included for consistent matrix notation.
  74. .SH SEE ALSO
  75. \f3glGet(3G)\fP, \%\f3gluProject(3G)\fP