DoDepthCue(3D)

NAME
DoDepthCue - Create a primitive attribute object defining depth cueing

SYNOPSIS
C:
DtObject DoDepthCue(zfront, zback, sfront, sback,
		colormodel, color)
DtReal zfront, zback, sfront, sback;
DtColorModel colormodel;
DtReal color[];

FORTRAN:
INTEGER*4 DODC(ZFRONT, ZBACK, SFRONT,
		SBACK, COLMOD, COLOR)
REAL*8 ZFRONT, ZBACK, SFRONT, SBACK
INTEGER*4 COLMOD
REAL*8 COLOR(*)

DESCRIPTION
DoDepthCue creates a depth cue primitive attribute object. The object is used to specify how primitive objects will be depth cued when the depth cue switch primitive attribute (set by DoDepthCueSwitch <DODCS>) is enabled. Note that depth cueing is on an object-by-object basis.

When the depth cue switch is enabled, a user-provided color is combined with that of a primitive object proportional to each part's distance from the viewer (i.e., Z-values in frame coordinates). If the depth cue switch is disabled, then the primitive object's color is unaffected.

The zfront and zback values define the Z-values in frame coordinates of two planes parallel to the XY plane. The sfront and sback values are numbers between 0 and 1 specifying the portion between the primitive's color and user-supplied depth cue color color to be used at each plane. The values for Z-values between sfront and sback are linearly interpolated. Note that the required parameter colormodel establishes the color model of the color parameter.

The displayed color DC at some depth Z in frame coordinates is related to the primitive's color C, the depthcue color color, the front and back Z-planes zfront and zback (with their associated values sfront and sback) as follows:

    If Z is in front of zfront, then
    	DC = sfront*C+(1-sfront)*color

    If Z is behind zback, then
    	DC = sback*C+(1-sback)*color

    If Z is between zfront and zback and if
    	r = sback+(((Z-zback)*(sfront-sback))/(zfront-zback))
    then
    	DC = r*C+(1-r)*color.

DEFAULTS
The default settings of DoDepthCue are (1.0, 0.0, 1.0, 0.0, DcRGB, (0.0, 0.0, 0.0)).

SEE ALSO
DoDepthCueSwitch(3D)