IDLgrLight

A light object represents a source of illumination for three-dimensional graphic objects. Lights may be either ambient, positional, directional, or spotlights. A maximum of 8 lights per view are allowed. Lights are not required for objects displayed in two dimensions.

An IDLgrLight object is an atomic graphic object ; it is one of the basic drawable elements of the IDL Object Graphics system, and it is not a container for other objects.

Superclasses

This class has no superclasses.

Subclasses

This class has no subclasses.

Creation

See IDLgrLight::Init

Methods

Intrinsic Methods

This class has the following methods:


IDLgrLight::Cleanup

The IDLgrLight:: Cleanup procedure method performs all cleanup on the object. IDLgrLight is described above.

Calling Sequence

OBJ_DESTROY, Obj

or

Obj -> [IDLgrLight::] Cleanup                               ( In a subclass' Cleanup method only .)

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrLight::GetCTM

The IDLgrLight:: GetCTM function method returns the 4 x 4 graphics transform matrix from the current object upward through the graphics tree. IDLgrLight is described above.

Calling Sequence

Result = Obj -> [IDLgrLight::] GetCTM()

Arguments

There are no arguments for this method.

Keywords

DESTINATION

Set this keyword to the object reference of a destination object to specify that the projection matrix for the View object in the current tree be included in the returned transformation matrix. The resulting matrix will transform a point in the data space of the object on which the GetCTM method is called into a normalized coordinate system (-1 to +1 in X, Y, and Z), relative to the View object that contains the light object.

TOP

Set this keyword equal to the object reference to an IDLgrModel object to specify that the returned matrix accumulate from the object on which the GetCTM method is called up to and including the specified model object.


IDLgrLight::GetProperty

The IDLgrLight:: GetProperty procedure method retrieves the value of a property or group of properties for the light. IDLgrLight is described above.

Calling Sequence

Obj -> [IDLgrLight::] GetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrLight::Init

ALL

Set this keyword to a named variable that will contain an anonymous structure containing the values of all of the properties associated with the state of this object. State information about the object includes things like color, range, tick direction, etc., but not image, vertex, or connectivity data, or user values.

PARENT

Set this keyword equal to a named variable that will contain an object reference to the object that contains this object.


IDLgrLight::Init

The IDLgrLight:: Init function method initializes the light object. IDLgrLight is described above.

Calling Sequence

Obj = OBJ_NEW('IDLgrLight')

or

Result = Obj -> [IDLgrLight::] Init( )         ( In a subclass' Init method only .)

Arguments

There are no arguments for this method.

Keywords

Properties retrievable via IDLgrLight::GetProperty

ATTENUATION (Get, Set)

Set this keyword to a 3-element floating point vector of the form [constant, linear, quadratic] that describes the factor by which light intensity is to fall with respect to distance from the light source. ATTENTUATION applies only to Positional and Spot lights, as specified by the TYPE keyword. The overall attenuation factor is computed as follows:

attenuation = 1/(constant + linear*distance + quadratic*distance^2)

By default, the values are [1, 0, 0].

COLOR (Get, Set)

Set this keyword to a three-element vector specifying the RGB color of the light. The default is [255, 255, 255], which is a white light. The color of a light is ignored when graphics are sent to graphics destinations using the Indexed color model, in which case light intensities are scaled into the range of colors available on the graphics destination.

CONEANGLE (Get, Set)

Set this keyword to the angle (measured in degrees) of coverage for a spotlight. The default is 60.

DIRECTION (Get, Set)

Set this keyword to the three-element vector representing the direction in which a spotlight is to be pointed. The default is [0,0,-1].

FOCUS (Get, Set)

Set this keyword to a floating-point value that describes the attenuation of intensity for spotlights as the distance from the center of the cone of coverage increases. This factor is used as an exponent to the cosine of the angle between the direction of the spotlight and the direction from the light to the vertex being lighted. The default is 0.0.

HIDE (Get, Set)

Set this keyword to a boolean value indicating whether this light should be enabled:

INTENSITY (Get, Set)

Set this keyword to a floating point value between 0.0 (darkest) and 1.0 (brightest) indicating the intensity of the light. The default is 1.0.

LOCATION (Get, Set)

Set this keyword to a vector of the form [ x , y , z ] describing the position of the light. By default, the position is [0, 0, 0].

NAME (Get, Set)

Set this keyword equal to a string containing the name associated with this object. The default is the null string, ' '.

TYPE (Get, Set)

Set this keyword to one of the following values, indicating the type of light. Valid values are:

 

UVALUE (Get, Set)

Set this keyword to a value of any type. You can use this "user value" to contain any information you wish. Remember that if you set the user value equal to a pointer or object reference, you should destroy the pointer or object reference explicitly when destroying the object it is a user value of.

XCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert X coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized X = s 0 + s 1 * Data X

Recommended values are:

[(- X min )/( X max - X min ), 1/( X max - X min )]

The default is [0.0, 1.0].

YCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert Y coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized Y = s 0 + s 1 * Data Y

Recommended values are:

[(- Y min )/( Y max - Y min ), 1/( Y max - Y min )]

The default is [0.0, 1.0].

ZCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert Z coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized Z = s 0 + s 1 * Data Z

Recommended values are:

[(- Z min )/( Z max - Z min ), 1/( Z max - Z min )]

The default is [0.0, 1.0].


IDLgrLight::SetProperty

The IDLgrLight:: SetProperty procedure method sets the value of a property or group of properties for the light. IDLgrLight is described above.

Calling Sequence

Obj -> [IDLgrLight::] SetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrLight::Init