/*
 * @name Multiple Lights
 * @description All types of lights could be used in one sketch.
 */
function setup(){
  createCanvas(710, 400, WEBGL);
}

function draw(){
  background(0);

  var locY = (mouseY / height - 0.5) * (-2);
  var locX = (mouseX / width - 0.5) * 2;

  ambientLight(50);
  directionalLight(200, 0, 0, 0.25, 0.25, 0.25);
  pointLight(0, 0, 200, locX, locY, 0);
  pointLight(200, 200, 0, -locX, -locY, 0);

  push();
  translate(-250, 0, 0);
  rotateZ(frameCount * 0.02);
  rotateX(frameCount * 0.02);
  specularMaterial(250);
  box(100, 100, 100);
  pop();

  translate(250, 0, 0);
  ambientMaterial(250);
  sphere(120, 64);
}
@@ -106,16 +106,17 @@
  setup()
+ 
 %7B%0A  crea
@@ -160,16 +160,17 @@
 n draw()
+ 
 %7B%0A  back
@@ -194,29 +194,28 @@
  loc
-Y
+X
  = 
-(
 mouse
-Y /
+X -
  height 
 - 0.
@@ -214,21 +214,11 @@
 ght 
-- 0.5) * (-2)
+/ 2
 ;%0A  
@@ -228,36 +228,28 @@
  loc
-X
+Y
  = 
-(
 mouse
-X /
+Y -
  width 
-- 0.5) *
+/
  2;%0A
@@ -289,18 +289,18 @@
 lLight(2
-00
+55
 , 0, 0, 
@@ -312,19 +312,16 @@
  0.25, 0
-.25
 );%0A  poi
@@ -335,18 +335,18 @@
 (0, 0, 2
-00
+55
 , locX, 
@@ -355,52 +355,10 @@
 cY, 
-0);%0A  pointLight(200, 200, 0, -locX, -locY, 
+25
 0);%0A
@@ -381,19 +381,25 @@
 nslate(-
-250
+width / 4
 , 0, 0);
@@ -528,19 +528,25 @@
 anslate(
-250
+width / 4
 , 0, 0);
@@ -586,12 +586,13 @@
 (120, 64);%0A%7D
+%0A

update multiple lights example