cls_Light - almarklein/visvis GitHub Wiki
Inherits from object.
A Light object represents a light source in the scene. It determines how lit objects (such as Mesh objects) are visualized.
Each axes has 8 light sources, of which the 0th is turned on by default. De 0th light source provides the ambient light in the scene (the ambient component is 0 by default for the other light sources). Obtain the lights using the axes.light0 and axes.lights properties.
The 0th light source is a directional camera light by default; it shines in the direction in which you look. The other lights are oriented at the origin by default.
The Light class implements the following properties:
ambient, color, diffuse, isCamLight, isDirectional, isOn, position, specular
The Light class implements the following methods:
Off, On
Get/Set the ambient color of the light. This is the color that is everywhere, coming from all directions, independent of the light position.
The value can be a 3- or 4-element tuple, a character in "rgbycmkw", or a scalar between 0 and 1 that indicates the fraction of the reference color.
Get/Set the reference color of the light. If the ambient, diffuse or specular properties specify a scalar, that scalar represents the fraction of this color.
Get/Set the diffuse color of the light. This component is the light that comes from one direction, so it's brighter if it comes squarely down on a surface than if it barely glances off the surface. It depends on the light position how a material is lit.
Get/Set whether the light is a camera light. A camera light moves along with the camera, like the lamp on a miner's hat.
Get/Set whether the light is a directional light. A directional light has no real position (it can be thought of as infinitely far away), but shines in a particular direction. The sun is a good example of a directional light.
Get whether the light is on.
Get/Set the position of the light. Can be represented as a 3 or 4 element tuple. If the fourth element is a 1, the light has a position, if it is a 0, it represents a direction (i.o.w. the light is a directional light, like the sun).
Get/Set the specular color of the light. This component represents the light that comes from the light source and bounces off a surface in a particular direction. This is what makes materials appear shiny.
The value can be a 3- or 4-element tuple, a character in "rgbycmkw", or a scalar between 0 and 1 that indicates the fraction of the reference color.
Turn the light off.
Turn the light on.