[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

lsetdepth Subroutine


Sets up a 3-D viewport.


Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void lsetdepth(Int32 near, Int32 far)


INTEGER*4 near, far


The lsetdepth subroutine takes the mapping furnished by the viewport subroutine and completes this mapping for homogeneous coordinates. The viewport subroutine specifies the mapping of the left, right, bottom, and top clipping planes into screen coordinates. The lsetdepth subroutine then specifies the mapping of the near and far clipping planes into values stored in the z-buffer. This subroutine is used in z-buffering and depth-cueing.

Acceptable mappings include all those where the values of the near and far parameters are within the supported range, including mappings where near > far.

  1. Error accumulation in the iteration of the z coordinate can cause wrapping when the full-depth range supported by the graphics hardware is used. (An iteration wraps when it accidentally converts a large positive value into a negative value or vice versa.) The effects of wrapping, although typically not observed, can be eliminated by reducing the depth range by a small percentage.
  2. The operation of this subroutine for the Supergraphics Processor Subsystem is modified. (See "Hardware Considerations";.)

The valid range of values for the lsetdepth subroutine can be found by querying with the getgdesc subroutine with the GD_ZMIN and GD_ZMAX tokens.

Note: The POWER Gt4x adapter supports a full 24-bit z range, from 0x0 to 0xFFFFFF. It does not support negative-signed integer values.


near Specifies the screen coordinate of the near clipping plane.
far Specifies the screen coordinate of the far clipping plane.


The example C language program depthcue.c uses the lsetdepth subroutine to set the range of z-axis values to store in the bitplanes.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

The POWERgraphics GXT1000 supports a repeat factor from 1 to 255. Query the maximum supported repeat factor with getgdesc(GD_MAX_LSREPEAT).


/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.

Related Information

Turning depth-cueing on and off with the depthcue subroutine.

Get information about the installed graphics hardware with the getgdesc subroutine.

Setting the viewport depth range with the lsetdepth subroutine.

AIX Graphics Library Overview, Configuring the Frame Buffer, Performing Depth-Cueing, Using Viewports and Screenmasks, and Working with Coordinate Systems.

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