Rediger

Del via


gluLookAt function

The gluLookAt function defines a viewing transformation.

Syntax

void WINAPI gluLookAt(
   GLdouble eyex,
   GLdouble eyey,
   GLdouble eyez,
   GLdouble centerx,
   GLdouble centery,
   GLdouble centerz,
   GLdouble upx,
   GLdouble upy,
   GLdouble upz
);

Parameters

eyex

The position of the eye point.

eyey

The position of the eye point.

eyez

The position of the eye point.

centerx

The position of the reference point.

centery

The position of the reference point.

centerz

The position of the reference point.

upx

The direction of the up vector.

upy

The direction of the up vector.

upz

The direction of the up vector.

Return value

This function does not return a value.

Remarks

The gluLookAt function creates a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an up vector. The matrix maps the reference point to the negative z-axis and the eye point to the origin, so that when you use a typical projection matrix, 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 up vector must not be parallel to the line of sight from the eye to the reference point.

The matrix generated by gluLookAt postmultiplies the current matrix.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Glu.h
Library
Glu32.lib
DLL
Glu32.dll

See also

glFrustum

gluPerspective