Defines a viewing transformation.
FORTRAN (libfgl.a)
void lookat (Coord viewx,Coord viewy, Coord viewz, Coord pointx, Coord pointy, Coord pointz, Angle twist)
SUBROUTINE LOOKAT(viewx, viewy, viewz, pointx, pointy, pointz, twist) REAL*4 viewx, viewy, viewz, pointx, pointy, pointz INTEGER*4 twist
Note: For FORTRAN users, this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.
The lookat subroutine defines the viewpoint and a reference point on the line of sight in world coordinates. The viewpoint is at (viewx, viewy, viewz), and is the position from which you are looking. The reference point is at (pointx, pointy, pointz), and is the location on which the viewpoint is centered. If pointx, pointy, and pointz are 0, you are looking at the origin of the world coordinate system. The viewpoint and reference point define the line of sight. The twist parameter measures right-hand rotation about the line of sight.
Normally, the lookat subrotuine is used to set up the mapping from world coordinates to eye coordinates (equivalently, to define the location of the viewer's eye in world coordinates). If the lookat subroutine is the first transformation subroutine called after projection matrix is set up and the matrix stack is initialized, it sets up such a mapping.
The lookat subroutine can also be used as a modeling transformation. Whether it behaves as a viewing transformation or a modeling transformation depends on the order in which it is called with respect to the other transformation subroutines and with respect to the drawing subroutines.
The example C language program zbuffer1.c uses the lookat subroutine to define the point of view.
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
/usr/include/gl/gl.h | Contains C language constant and variable type definitions for GL. |
/usr/include/gl/fgl.h | Contains FORTRAN constant and variable type definitions for GL. |
Defining the viewer's position in polar coordinates with the polarview subroutine.
AIX Graphics Library Overview and Working with Coordinate Systems.