![]() |
![]() ![]() |
access a Graphics Display Kit light
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 ;
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 ;
void GDlight_detach_xform ( light_id, int flag );
OMobj_id light_id , xform_id ;
NULL,
OMobj_id light_id ,
0,
GDlight * light );
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.
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.
(GDlight_attach_xform only) The id of a transformation object.
(GDlight_delete only) The light object's local pointer. To get this value, call the utility routine GDget_local.
(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.
/* 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);
![]() |
![]() ![]() |