Skip to content

Commit

Permalink
Merge pull request #5315 from JetStarBlues/improveLightFalloffExample
Browse files Browse the repository at this point in the history
Improve clarity of `lightFalloff()` example
  • Loading branch information
stalgiag authored Jul 28, 2021
2 parents bb4bb24 + 260e803 commit 389c635
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/webgl/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
* }
* </code>
* </div>
Expand Down

0 comments on commit 389c635

Please sign in to comment.