From 260e803841b9f84a45360b4dedf2f0c37ad6713d Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Mon, 14 Jun 2021 18:57:22 -0600 Subject: [PATCH] Improve clarity of `lightFalloff()` example --- src/webgl/light.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/webgl/light.js b/src/webgl/light.js index e16c789d16..b39ae47574 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -443,17 +443,26 @@ p5.prototype.lights = function() { * noStroke(); * } * function draw() { + * ortho(); * background(0); + * * let locX = mouseX - width / 2; * let locY = mouseY - height / 2; - * translate(-25, 0, 0); + * locX /= 2; // half scale + * * lightFalloff(1, 0, 0); - * pointLight(250, 250, 250, locX, locY, 50); + * push(); + * translate(-25, 0, 0); + * pointLight(250, 250, 250, locX - 25, locY, 50); * sphere(20); - * translate(50, 0, 0); - * lightFalloff(0.9, 0.01, 0); - * pointLight(250, 250, 250, locX, locY, 50); + * pop(); + * + * lightFalloff(0.97, 0.03, 0); + * push(); + * translate(25, 0, 0); + * pointLight(250, 250, 250, locX + 25, locY, 50); * sphere(20); + * pop(); * } * *