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

gluLookAt Subroutine

Purpose

Defines a viewing transformation.

Library

OpenGL C bindings library: libGL.a

C Syntax

void gluLookAt(GLdouble EyeX, 
   GLdouble EyeY, 
   GLdouble EyeZ, 
   GLdouble CenterX, 
   GLdouble CenterY, 
   GLdouble CenterZ, 
   GLdouble UpX, 
   GLdouble UpY, 
   GLdouble UpZ)

Description

The gluLookAt subroutine creates a viewing matrix based upon an eye point, a reference point indicating the center of the scene, and an up vector. The matrix created by this subroutine maps the reference point to the negative z axis and the eye point to the origin. As a result, when a typical projection matrix is used, the center of the scene maps to the center of the viewport. Similarly, the direction described by the up vector projected onto the viewing plane is mapped to the positive y axis so that it points upward in the viewport.

The matrix generated by the gluLookAt subroutine postmultiplies the current matrix.

Note: The up vector must not be parallel to the line of sight from the eye point to the reference point.

Parameters

EyeX, EyeY, EyeZ Specifies the position of the eye point.
CenterX, CenterY, CenterZ Specifies the position of the reference point.
UpX, UpY, UpZ Specifies the direction of the up vector.

Files

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

Related Information

The glFrustum subroutine, gluPerspective subroutine.

OpenGL Overview.


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