GDIndex.gif Previous-2.gif Next-3.gif

GDlight_xxxx- GD API


Synopsis

access a Graphics Display Kit light

GDlight_get_xxxx

void   GDlight_get_type ( light_id ,  int  * type  );
void   GDlight_get_state ( light_id ,  int  * state  );
void   GDlight_get_color ( light_id ,  float  * color  );
void   GDlight_get_att ( light_id ,  float  * att  );
void   GDlight_get_concen ( light_id ,  float  * concen  );
void   GDlight_get_angle ( light_id ,  float  * angle  );

OMobj_id   light_id ;

 

GDlight_set_xxxx

void   GDlight_set_type ( light_id ,  int   type  );
void   GDlight_set_state ( light_id ,  int   state  );
void   GDlight_set_color ( light_id ,  float  * color  );
void   GDlight_set_att ( light_id ,  float  * att  );
void   GDlight_set_concen ( light_id ,  float   concen  );
void   GDlight_set_angle ( light_id ,  float   angle  );

OMobj_id   light_id ;

 

GDlight_xxxx_xform

void   GDlight_attach_xform ( light_id ,   xform_id , int flag );
void   GDlight_detach_xform ( light_id, int flag );

OMobj_id   light_id ,   xform_id ;

 

GDlight_delete

void   GDlight_delete (
NULL,
OMobj_id   light_id ,
0,
GDlight  * light  );

 

GDlight_reset

void   GDlight_reset (GDlight  * light );

 

Description

These routines are used to access the Graphics Display Kit light.

The GDlight_get_xxxx routines get the subobject values of the light. The GDlight_set_xxxx routines set the subobject values of a light. These routines are used by the Graphics Display Kit light editor (i.e., GDlight_edit).

GDlight_attach_xform attaches a transform to the light. If the light is already attached to a transform, the routine returns without changing the transform. GDlight_detach_xform detaches the transform from the light.

GDlight_delete deletes the light. This method is called directly by the Object Manager when a light is deleted.

GDlight_reset resets the light's subobjects to their default values. The default values are those in specified in DefaultLight

To create an instance of a light, call the utility routine GDcreate_instance.

Parameters

light_id

The id of a light.

Other get/set parameters

The other parameters in the get/set routines correspond to subobjects of the light object.

For details, see DefaultLight and DefaultLightOn .

The color parameter is a three-element array. The att parameter is a two-element array.

xform_id

(GDlight_attach_xform only)  The id of a transformation object.

light

(GDlight_delete only)  The light object's local pointer. To get this value, call the utility routine GDget_local.

flag

(GDlight_attach/detach_xforn only) This argument controls whether the routine actually attaches the transform to the light: 0 means no; 1 means yes. In normal usage within the Graphics Display Kit, the flag is set to 0. If you are using the routines programatically, set the flag to 1.

Example


/* Get and set a light object's angle subobject. */
OMobj_id light_id; /* Assume this has been set. */
float angle;
...
GDlight_get_angle(light_id, &angle);
angle *= 0.9;
GDlight_set_angle(light_id, angle);

 



GDIndex.gif Previous-2.gif Next-3.gif