LIGHT_SOURCE(3G)
NAME
light_source − define light source positions and colors
SYNOPSIS
C Syntax:
void light_source(fildes,index,type,red,green,blue,x,y,z);
int fildes,index,type;
float red,green,blue,x,y,z;
FORTRAN77 Syntax:
subroutine light_source(fildes,index,type,red,green,blue,x,y,z)
integer*4 fildes,index,type
real red,green,blue,x,y,z
Pascal Syntax:
procedure light_source(fildes,index,type:integer;
red,green,blue,x,y,z:real);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
index Selects the light source to be modified (1 through 8)
type Selects the light source type from DIRECTIONAL, POSITIONAL
red,green,blue Values (in the range 0.0 to 1.0) that define the color of the light source.
x,y,z x,y,z coordinate position of the light source or a vector pointing to the light source. Note that if this is a vector, it does not need to be normalized to unit length.
Discussion
Light_source specifies the location and color of different light sources which are then used in shading of filled polygons. Up to eight (8) different light sources can be specified.
The type parameter can be one of the following:
DIRECTIONAL Point source at infinity. The x,y,z parameters specify a vector anchored at the origin and directed toward the light source.
POSITIONAL Point source close to viewing area. The x,y,z parameters specify the position of the light source in world coordinates.
Additional aspects of POSITIONAL light sources can be set with light_model .
DEFAULTS
DIRECTIONAL directed at x=0.0, y=0.0, z=-1.0 with red=1.0, green=1.0, blue=1.0
SEE ALSO
light_ambient(3G), light_model(3G), light_switch(3G), shade_mode(3G), surface_model(3G), vertex_format(3G),
Starbase Graphics Techniques.
Hewlett-Packard Company — May 11, 2021