~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/doc/man/GLU/lookat.3gl

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 lookat.gl
 
9
.ds Xs 1014 4 lookat.gl
 
10
.TH GLULOOKAT 3G
 
11
.SH NAME
 
12
.B "gluLookAt
 
13
\- define a viewing transformation
 
14
 
 
15
.SH C SPECIFICATION
 
16
void \f3gluLookAt\fP(
 
17
GLdouble \fIeyeX\fP,
 
18
.nf
 
19
.ta \w'\f3void \fPgluLookAt( 'u
 
20
        GLdouble \fIeyeY\fP,
 
21
        GLdouble \fIeyeZ\fP,
 
22
        GLdouble \fIcenterX\fP,
 
23
        GLdouble \fIcenterY\fP,
 
24
        GLdouble \fIcenterZ\fP,
 
25
        GLdouble \fIupX\fP,
 
26
        GLdouble \fIupY\fP,
 
27
        GLdouble \fIupZ\fP )
 
28
.fi
 
29
 
 
30
.EQ
 
31
delim $$
 
32
.EN
 
33
.SH PARAMETERS
 
34
.TP \w'\f2eyeX\fP\ \f2eyeY\fP\ \f2eyeZ\fP\ \ 'u 
 
35
\f2eyeX\fP, \f2eyeY\fP, \f2eyeZ\fP
 
36
Specifies the position of the eye point.
 
37
.TP
 
38
\f2centerX\fP, \f2centerY\fP, \f2centerZ\fP
 
39
Specifies the position of the reference point.
 
40
.TP
 
41
\f2upX\fP, \f2upY\fP, \f2upZ\fP
 
42
Specifies the direction of the \f2up\fP vector.
 
43
.SH DESCRIPTION
 
44
\%\f3gluLookAt\fP creates a viewing matrix derived from an eye point, a reference
 
45
point indicating the center of the scene, and an \f2UP\fP vector.  
 
46
.P
 
47
The matrix
 
48
maps the reference point to the negative \f2z\fP axis and the
 
49
eye point to the origin.
 
50
When a typical projection matrix is used,
 
51
the center of the scene therefore maps to the center of the viewport.
 
52
Similarly, the direction described by the \f2UP\fP
 
53
vector projected onto the viewing plane is mapped to the positive \f2y\fP 
 
54
axis so that it points upward in the viewport.
 
55
The \f2UP\fP vector must not be parallel to the line of sight from the
 
56
eye point to the reference point.
 
57
.P
 
58
Let 
 
59
.sp
 
60
.EQ
 
61
F ~=~ left (  down 20 { ~ matrix {
 
62
   ccol {"centerX" above "centerY" above "centerZ"}
 
63
   ccol { ~-~ above ~-~ above ~-~}
 
64
   ccol {"eyeX" above "eyeY" above "eyeZ"}
 
65
} } ~~ right )
 
66
 
 
67
.EN
 
68
 
 
69
.sp
 
70
Let \f2UP\fP be the vector $("upX", "upY", "upZ")$. 
 
71
.P
 
72
Then normalize as follows: 
 
73
.EQ
 
74
f ~=~ F over {|| F ||}
 
75
.EN
 
76
.P
 
77
.EQ
 
78
UP sup prime ~=~ UP over {|| UP ||}
 
79
.EN
 
80
.sp
 
81
.P
 
82
Finally, let $s ~=~ f ~times~ UP sup prime$, and $u ~=~ s ~times~ f$.
 
83
.P
 
84
.sp
 
85
M is then constructed as follows:
 
86
.EQ
 
87
M ~=~ left (  matrix {
 
88
   ccol { ~s[0] above ~u[0] above -f[0] above 0 }
 
89
   ccol { ~s[1] above ~u[1] above -f[1] above 0 }
 
90
   ccol { ~s[2] above ~u[2] above -f[2] above 0 }
 
91
   ccol { 0 above 0 above 0  above 1 }
 
92
} ~~right )
 
93
.EN
 
94
.P
 
95
and \%\f3gluLookAt\fP is equivalent to 
 
96
.Ex
 
97
glMultMatrixf(M);
 
98
glTranslated (-eyex, -eyey, -eyez);
 
99
.Ee
 
100
.SH SEE ALSO
 
101
\f3glFrustum(3G)\fP, \%\f3gluPerspective(3G)\fP