Skip to content

Commit

Permalink
Merge pull request #5313 from JetStarBlues/improveNoLightsExample
Browse files Browse the repository at this point in the history
Improve clarity of `noLights()` example
  • Loading branch information
stalgiag authored Jul 28, 2021
2 parents 1d7cedc + 53f5cb6 commit bb4bb24
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/webgl/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -861,25 +861,30 @@ p5.prototype.spotLight = function(
* createCanvas(100, 100, WEBGL);
* }
* function draw() {
* background(0);
* background(200);
* noStroke();
*
* ambientLight(150, 0, 0);
* translate(-25, 0, 0);
* ambientMaterial(250);
* sphere(20);
* ambientLight(255, 0, 0);
* translate(-30, 0, 0);
* ambientMaterial(255);
* sphere(13);
*
* noLights();
* ambientLight(0, 150, 0);
* translate(50, 0, 0);
* ambientMaterial(250);
* sphere(20);
* translate(30, 0, 0);
* ambientMaterial(255);
* sphere(13);
*
* ambientLight(0, 255, 0);
* translate(30, 0, 0);
* ambientMaterial(255);
* sphere(13);
* }
* </code>
* </div>
*
* @alt
* Two spheres showing different colors
* Three white spheres. Each appears as a different
* color due to lighting.
*/
p5.prototype.noLights = function() {
this._assert3d('noLights');
Expand Down

0 comments on commit bb4bb24

Please sign in to comment.