Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

SET LIGHT SOURCE REPRESENTATION(3P+)  —  Kubota Pacfic Computer Inc. (29 February 1991)

NAME

SET LIGHT SOURCE REPRESENTATION − define a light source representation entry in the workstation table of defined light source representations

SYNOPSIS

C Syntax

void
pset_light_src_rep ( ws, index, rep )
Pintws;workstation identifier
Pintindex;light table index
Plight_src_bundle∗rep; light source representation

Required PHIGS Operating States

(PHOP, WSOP, ∗, ∗)

DESCRIPTION

Purpose

SET LIGHT SOURCE REPRESENTATION defines a light source representation for a specified index number on the workstation table of defined light source representations. Each integer entry on this table specifies a light source type (Ambient, Directional, Positional, or Spot) and a data record containing the parameters needed to define the light source type. 

Defined light sources are activated or deactivated with the SET LIGHT SOURCE STATE subroutine. When lighting and shading are applied to a display, the currently active light sources are used, with the current surface properties and interior lighting and shading methods, to render the following area defining primitives: FILL AREA 3, FILL AREA SET 3, and FILL AREA SET 3 WITH DATA. 

C Input Parameters

wsThe workstation identifier specifies the workstation for which the light source representation is to be defined. The workstation must have been opened with the OPEN WORKSTATION subroutine before calling SET LIGHT SOURCE REPRESENTATION. 

indexThe number of the entry to be defined on the table of defined light source representations, in the specified workstation state list. 

repA pointer to light source representation. The Plight_src_bundle data structure contains values needed to define the specified type of light source representation. Plight_src_bundle is defined as:

typedef struct {
Pinttype;/∗ light source type ∗/
Plight_src_recrec;/∗ light source data record ∗/
} Plight_src_bundle;

The predefined light source types are:

1PLIGHT_AMBIENTAmbient Light Source
2PLIGHT_DIRECTIONALDirectional Light Source
3PLIGHT_POSITIONALPositional Light Source
4PLIGHT_SPOTSpot Light Source

Plight_src_rec is defined as:

typedef union {
Pamb_light_src_recambient;
Pdir_light_src_recdirectional;
Ppos_light_src_recpositional;
Pspot_light_src_recspot;
} Plight_src_rec;

Pamb_light_src_rec is defined as:

typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
} Pamb_light_src_rec;

Pgcolr is defined as:

typedef struct {
Pinttype;/∗ indirect, RGB, CIE, HSV, HLS ∗/
union {
     Pintind;/∗ index in workstation colour bundle table ∗/
     struct {
          Pfloatx;/∗ red, hue, etc. ∗/
          Pfloaty;/∗ green, saturation, lightness, etc. ∗/
          Pfloatz;/∗ blue, value, saturation, etc. ∗/
     } general;
} val;
} Pgcolr;

Pdir_light_src_rec is defined as:

typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
Pvec3dir;/∗ light source direction ∗/
} Pdir_light_src_rec;

Pvec3 is defined as:

typedef struct {
Pfloatdelta_x;/∗ x magnitude ∗/
Pfloatdelta_y;/∗ y magnitude ∗/
Pfloatdelta_z;/∗ z magnitude ∗/
} Pvec3;

Ppos_light_src_rec is defined as:

typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
Ppoint3pos;/∗ light source position ∗/
Pfloatcoef[2];/∗ attenuation coefficients ∗/
} Ppos_light_src_rec;

Ppoint3 is defined as:

typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;

Pspot_light_src_rec is defined as:

typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
Ppoint3pos;/∗ light source position ∗/
Pvec3dir;/∗ light source direction ∗/
Pfloatexp;/∗ concentration exponent ∗/
Pfloatcoef[2];/∗ attenuation coefficients ∗/
Pfloatangle;/∗ spread angle ∗/
} Pspot_light_src_rec;

Execution

When SET LIGHT SOURCE REPRESENTATION is called, the light source index entry in the table of defined light source representations on the workstation is set to the new attribute values. 

ERRORS

003Ignoring function, function requires state (PHOP,WSOP,∗,∗)

054Ignoring function, the specified workstation is not open

059Ignoring function, the specified workstation does not have output capability (that is, the workstation category is neither OUTPUT, OUTIN, nor MO)

103Ignoring function, setting this bundle table entry would exceed the maximum number of entries allowed in the workstation bundle table

169Ignoring function, the specified light direction is invalid

614Ignoring function, the light source index is less than one

617Ignoring function, the specified light source type is not available on the workstation

618Ignoring function, the specified spot light spread angle is out of range

SEE ALSO

SET REFLECTANCE PROPERTIES (3P+)
SET REFLECTANCE EQUATION (3P+)
INQUIRE LIST OF LIGHT SOURCE INDICES (3P+)
INQUIRE LIGHT SOURCE REPRESENTATION (3P+)
INQUIRE LIGHT SOURCE FACILITIES (3P+)
INQUIRE PREDEFINED LIGHT SOURCE REPRESENTATION (3P+)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026