DefaultLight and DefaultLightOn


Synopsis

define a Graphics Display Kit light

GDlight_templ


group+OPort  GDlight_templ
{
int  type;
int  state;
float  col[3];
float  att[2];
float  concen;
float  angle;
GDxform_templ+IPort2  &xform;
};

 

GDlight


GDlight_templ  GDlight
<NEiconName="light"> {
ptr+nonotify+nosave  local_ptr;
};

 

DefaultLight


GDlight  DefaultLight
{
type = GD_DEFAULT_LIGHT_TYPE;
state = 0;
col = {GD_DEFAULT_RED, GD_DEFAULT_GREEN, GD_DEFAULT_BLUE};
att = {GD_DEFAULT_ATTEN, GD_DEFAULT_ATTEN};
concen = GD_DEFAULT_CONCEN;
angle = GD_DEFAULT_ANGLE;
};

 

DefaultLight


GDlight  DefaultLightOn
{
type = GD_DEFAULT_LIGHT_TYPE;
state = 1;
col = {GD_DEFAULT_RED, GD_DEFAULT_GREEN, GD_DEFAULT_BLUE};
att = {GD_DEFAULT_ATTEN, GD_DEFAULT_ATTEN};
concen = GD_DEFAULT_CONCEN;
angle = GD_DEFAULT_ANGLE;
};

Description

These templates define a Graphics Display Kit light. GDlight_templ defines the elements that cause the light's methods to execute. GDlight defines an instanceable version without default values. DefaultLight defines an instanceable version with default values. DefaultLightOn is like DefaultLight, except that the light source is enabled.

Input Ports

xform

A transformation that determines the light's orientation. xform is a connection to an element that matches type GDxform_templ.

Parameters

type

The parameter controls the light's type:

Value

Meaning

Symbolic constant

0

A directional light

GD_LIGHT_DIR

1

A point light

GD_LIGHT_PT

2

A spot light

GD_LIGHT_SPOT

3

A bi-directional light

GD_LIGHT_BIDIR

 

state

This parameter controls whether the light source is enabled: 0 means disabled; 1 means enabled.

col

This parameter controls the light's color, in terms of RGB. Valid values are in the range 0-1.

att

(Point lights and spot lights only)  This parameter controls the light's attenuation coefficients, specified as two numbers.

concen

(Spot lights only)  This parameter controls the light's concentration exponent.

angle

(Spot lights only)  This parameter controls the light's spread angle, in degrees.

Example

Libraries.Graphics_Display.Views.View3D

File

v/gdif.v