[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface : Subroutine Reference

GPSPR - Set Surface Properties

GPSPR (amb, diff, spec, exp, trans)

Purpose

Use GPSPR to insert a Set Surface Properties structure element into the open structure following the element pointer or to replace the element pointed at by the element pointer with a Set Surface Properties structure element depending on the current edit mode.

During structure traversal, this structure element specifies the coefficients and exponents which the graPHIGS API uses in calculating lighting and transparency effects.

If face distinguish mode (GPFDMO) is set to 1=NONE , then the graPHIGS API uses these values to calculate the lighting and transparency effects on both the front and back facing portions of a surface. If face distinguish mode is set to 2=COLOR_SURFACE_PROPERTIES , then the graPHIGS API uses these values to calculate the effects on only the front facing portions of a surface.

The traversal default for the coefficients and exponent for the surface properties are as follows:

The transparency mode (GPXVR) for the view must be set to a value other than 1=NONE for the graPHIGS API to use the specified transparency coefficient.

The current transparency coefficient in the graPHIGS API Traversal State List is also set by the transparency coefficient of the Set Transparency Coefficient (GPTCO) subroutine.

Parameters

amb -- specified by user, short floating-point number

Ambient reflection coefficient (0<= amb<=1)

diff -- specified by user, short floating-point number

Diffuse reflection coefficient (0<= diff<=1)

spec -- specified by user, short floating-point number

Specular reflection coefficient (0<= spec<=1)

exp -- specified by user, short floating-point numbers

Specular reflection exponent (>=0)

trans -- specified by user, short floating-point number

Transparency coefficient (0<= trans<=1)

Error Codes

5
FUNCTION REQUIRES STATE STOP OR NROP (NOT STCL)
111
AMBIENT COEFFICIENT IS INVALID
112
DIFFUSE COEFFICIENT IS INVALID
113
SPECULAR COEFFICIENT IS INVALID
114
SPECULAR EXPONENT IS INVALID
115
TRANSPARENT COEFFICIENT IS INVALID

Related Subroutines

GPBSPR
Set Back Surface Properties
GPLMO
Set Lighting Calculation Mode
GPLSR
Set Light Source Representation
GPLSS
Set Light Source State
GPRMO
Set Reflectance Model
GPTCO
Set Transparency Coefficient

RCP code

201343493 (X'0C004205')


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