1GLUPROJECT(3G) OpenGL Manual GLUPROJECT(3G)
2
3
4
6 gluProject - map object coordinates to window coordinates
7
9 GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ,
10 const GLdouble * model, const GLdouble * proj,
11 const GLint * view, GLdouble* winX, GLdouble* winY,
12 GLdouble* winZ);
13
15 objX, objY, objZ
16 Specify the object coordinates.
17
18 model
19 Specifies the current modelview matrix (as from a glGetDoublev()
20 call).
21
22 proj
23 Specifies the current projection matrix (as from a glGetDoublev()
24 call).
25
26 view
27 Specifies the current viewport (as from a glGetIntegerv() call).
28
29 winX, winY, winZ
30 Return the computed window coordinates.
31
33 gluProject transforms the specified object coordinates into window
34 coordinates using model, proj, and view. The result is stored in winX,
35 winY, and winZ. A return value of GLU_TRUE indicates success, a return
36 value of GLU_FALSE indicates failure.
37
38 To compute the coordinates, let v = objX objY objZ 1.0 represented as a
39 matrix with 4 rows and 1 column. Then gluProject computes v ″ as
40 follows:
41
42 v ″ = P × M × v
43
44 where P is the current projection matrix proj and M is the current
45 modelview matrix model (both represented as 4 × 4 matrices in
46 column-major order).
47
48 The window coordinates are then computed as follows:
49
50 winX = view 0 + view 2 × v ″ 0 + 1 2.PP winY = view 1 + view
51 3 × v ″ 1 + 1 2.PP winZ = v ″ 2 + 1 2
52
54 gluUnProject(), glGet()
55
57 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
58 under the SGI Free Software B License. For details, see
59 http://oss.sgi.com/projects/FreeB/.
60
62 opengl.org
63
64
65
66opengl.org 06/10/2014 GLUPROJECT(3G)