GINO Graphics Suite - GINO v9.0  

gDefineLightSource

Syntax

[C/C++:]
void gDefineLightSource(int light, int colour, ...);
[F90:]
subroutine gDefineLightSource(light, colour, gDir, gAtten1, gAtten2, gPos,  gConc, gSpread, gSpec) 

integer, intent(in) :: light,colour

type (GPOINT3), optional, intent(in) :: gDir,gPos
real, optional, intent(in) :: gAtten1,gAtten2,gConc,gSpread
integer, optional, intent(in) :: gSpec

Arguments

light
Light source number (1-8)

colour
Light colour (index or 24bit true colour value)

Optional Args

gDir
Direction vector

gAtten1
Point/spot light constant attenuation factor (default = 1.0)

gAtten2
Point/spot light linear attenuation factor (default = 0.0)

gPos
Spot light position(default = GPOINT3(0.0,0.0,0.0))

gConc
Spot light concentration in range 0.0 to 100.0 (default = 0.0)

gSpread
Spot light spread angle in range 0.0 to 360.0 (default = 180.0)

gSpec
Specular component colour (index or 24bit true colour value) (default = white)

Description

The routine gDefineLightSource() specifies the attributes of an individual light source, with its type depending on the number of optional arguments that are defined according to the following table:

Type         Obligatory              Optional            
Ambient      light,colour            gSpec
Directional  light,colour,gDir       gSpec
Point Light  light,colour,gPos       gAtten1,gAtten2,gSpec
Spot Light   light,colour,gPos,gDir  gConc,gSpread,gSpec
                                     gAtten1,gAtten2


When defining a directional light source the direction vector gDir points to the source of light, but when defining a spot light, the direction vector gDir defines the direction in which the light is shining.

Lights must be switched on to work (see gSetLightSwitch()).

See Also

gDefineLightSource Usage
gSetLightSwitch