User's Reference - Light

### Light

Category

Rendering

Function

Creates a distant light source.

Syntax

    light = Light(where, color, camera);

Inputs

Name | Type | Default | Description
--- | --- | --- | ---
`where` | vector or camera | [0 0 1] | position or direction of light
`color` | vector or string | [1 1 1] | color and intensity of light
`camera` | flag | 0 | 0: fixed direction 1: direction relative to camera

Outputs

Name | Type | Description
--- | --- | ---
`light` | light | a distant light

Functional Details

`where` | specifies the direction to the light source. If this parameter is specified as a camera rather than as a vector, the module positions the light source behind the camera and to its left (this is also the default light supplied by Data Explorer).
`color` | specifies the color and intensity of the light either as an RGB vector or as a color-name string. The color name must be one of the defined color-name strings (see Color).
`camera` | specifies that `where` is to be interpreted relative to the camera coordinate system rather than the world coordinate system. If `where` is a camera, then the specification `camera` = 0 is an error.

Use the Collect module to incorporate the output light in the scene given to the Render, Display, or Image.

If no light is present in the object passed to the Render, Display, or Image tool, a distant light of color [1 1 1] (behind and 45 degrees to the left of the viewer) is automatically incorporated in the scene. A small amount of ambient light is also used. Data Explorer removes these default lights if any light has been specified. The effect of the system's default lights by combining an ambient light (generated by using the default settings of AmbientLight) with the distant light generated by the Light module when a camera is specified for the `where` parameter.

Lights have no effect on volume-rendered objects.

Example Visual Programs

    ThunderGlyphSheet.net
    UsingLight.net

See Also

AmbientLight, Collect, Color, Convert

[ OpenDX Home at IBM | OpenDX.org ]