a port of the Processing Visualization Language
Name

lights()

Examples
example pic
size(100, 100, P3D);
background(0);
noStroke();
// Sets the default ambient 
// and directional light
lights();
translate(20, 50, 0);
sphere(30);
translate(60, 0, 0);
sphere(30);
example pic
void setup() {
  size(100, 100, P3D);
  background(0);
  noStroke();
}

void draw() {
  // Add lights at the beginning
  // of draw() to keep them persistent 
  lights();
  translate(20, 50, 0);
  sphere(30);
  translate(60, 0, 0);
  sphere(30);
}
Description

Sets the default ambient light, directional light, falloff, and specular values. The defaults are are ambientLight(128, 128, 128) and directionalLight(128, 128, 128, 0, 0, -1), lightFalloff()(1, 0, 0), and lightSpecular(0, 0, 0). Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop.

Syntax
lights()
Returns None
Usage Web & Application
Related noLights()
directionalLights()
ambientLight()
pointLight()
spotLight()

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub