TOC PREV NEXT INDEX

DefaultLight, DefaultLightOn

Synopsis

define a Graphics Display Kit light

GDlight_templ

group+OPort GDlight_templ {
enum+read type {
choices = {"Directional", "Point", "Spot", "BiDirectional"};
};
int state;
float col<animate=1>[3];
float att<animate=1>[2];
float concen<animate=1>;
float angle<animate=1>;
GDxform_templ+IPort2 &xform;
ptr+nonotify local_ptr<NEvisible=0>;
};

GDlight

GDlight_templ GDlight<NEsmallPixmapName="light.bmx",cxx_name="GDXlight"> {
local_ptr+write;
method+notify_inst+notify_val upd_func = "GDlight_update";
method+notify_deinst del_func = "GDlight_delete";
};

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_LIGHT_DIR;
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

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.

Output Port


Example

Libraries.Graphics_Display.Views.View3D

File

v/gdif.v

See also related modules

Not Applicable.

TOC PREV NEXT INDEX