NAME
set_light - set a light source for 3d rendering
PROTOTYPE
unitptr set_light( int iLight, float fX, float fY, float fZ, float fRed, float fGreen, float fBlue, float fRedAmb, float fGreenAmb, float fBlueAmb, char *pcOpt, unitptr host)
ARGUMENTS
- int iLight
- the light to be used (0..7)
- float fX
- x-coord of light position or direction
- float fY
- y-coord of light position or direction
- float fZ
- z-coord of light position or direction
- float fRed
- intensity of red channel
- float fGreen
- of green channel
- float fBlue
- of blue channel
- float fRedAmb
- contribution to red ambient light
- float fGreenAmb
- contribution to green ambient light
- float fBlueAmb
- contribution to blue ambient light
- char *pcOpt
- options (see below; may be NULL)
- unitptr host
- host unit
INTERFACE:
- in_0[3]
- cartesian position or direction of light
- in_1[3]
- r,g,b color (specular and diffuse) of light
- in_2[3]
- ambient r,g,b color of light
- in_3[1]
- (control pin) this value linearly scales
the light intensity of this light. A value
of zero switches this light off.
DESCRIPTION:
Sets properties for one of 8 available lights, chosen by the index
iLight. The specified properties are updated whenever the unit
is executed and remain in effect until overwritten by execution
of another set_light unit for the same light (i.e., several units
for the same light are allowed to exist). Unless otherwise specified
with any of the options below, the default light is directional
(i.e., at infinite distance) with no attenuation specified.
OPTIONS:
The following options are recognized in pcOpt:
- %c:l:qL
- choose local light with
constant, linear and quadratic attenuation
c,l,q. This modulates the local
light intensity by a factor of 1/(c+l*r+q*r*r), where
r is the distance between object point and
light. Default values for c,l,q are
(1,0,0) (i.e., no attenuation).
- %x:y:z:eS
- define a spot light direction
of (x,y,z) and a spot exponent of e.
Default values for x,y,z,e are (0,0,-1,0).
- %wC
- define a spot cutoff angle of w degrees
(allowed values are 0-90 or 180 degrees)
These are essentially the options that are available
for the OpenGL glLightf function. Thus, for a fuller description,
refer to the OpenGL Manual.
FILE
/local/homes/rhaschke/nst7/man/../o.linx86_64//../foldersrc/nst_solid.c