guLookAtStereo.3p 1.75 KB
.TH guLookAtStereo 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
guLookAtStereo, guLookAtStereoF \- computes a 'lookat' viewing matrix suitable for stereographic projections.
.SH C SPECIFICATION
.nf
\f3#include "gu.h"

void guLookAtStereo(Mtx m, 
		float xEye, float yEye, float zEye,
		float xAt,  float yAt,  float zAt,
		float xUp,  float yUp,  float zUp,
		float eyedist )

void guLookAtStereoF(float m[4][4], 
		float xEye, float yEye, float zEye,
		float xAt,  float yAt,  float zAt,
		float xUp,  float yUp,  float zUp,
		float eyedist )

\fP
.fi
.SH PARAMETERS
.TP 10
.I m
resulting 4x4 viewing matrix.
.TP
.I xEye, yEye, zEye
eye position.
.TP
.I xAt, yAt, zAt
center of interest in the direction we are looking.
.TP
.I xUp, yUp, zUp
up direction vector.
.TP
.I eyedist
the distance from the viewing axis of "this eye". If 
.I eyedist 
is positive, the resulting matrix is for the "right"
eye, if 
.I eyedist 
is negative, the resulting matrix is for the "left" eye.
.SH DESCRIPTION
.I guLookAtStereo
Returns a fixed-point 4x4 matrix
.B m,
which can be used for one view of a stereographic projection.
Normally this function must be called twice, calculating different
images for the left and right eyes.
Use a positive eyedist to calculate a matrix for rendering the right eye's 
view and the negative of that eyedist to calculate the matrix for the left
eye's view.  Unlike the 
.I guLookAt
function, the distance from the eye (xEye,yEye,zEye) to the At position
(xAt,yAt,zAt) is important in the 
.I guLookAtStereo
function.  The At
point is where the eyes focus.

.PP
For a detailed description of the 
fixed-point matrix format, see
.I gSPMatrix (3P).
.PP
.I guLookAtStereoF
Returns a floating-point 4x4 matrix
.B m. 
.PP

.SH SEE ALSO
.IR gSPMatrix (3P)
.IR gluLookAt (3G)