Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation clarity of light methods #5312

Merged
merged 5 commits into from
Feb 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor comment cleanup
  • Loading branch information
JetStarBlues committed Feb 21, 2022
commit 346a9ee9ee6ab048c75f0bb25d0870928e056726
24 changes: 12 additions & 12 deletions src/webgl/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,16 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) {
* }
* function draw() {
* background(0);
* //move your mouse to change light position
* // move your mouse to change light position
* let locX = mouseX - width / 2;
* let locY = mouseY - height / 2;
* // to set the light position,
* // think of the world's coordinate as:
* // -width/2,-height/2 -------- width/2,-height/2
* // | |
* // | 0,0 |
* // | |
* // -width/2,height/2--------width/2,height/2
* // -width/2,-height/2 ----------- width/2,-height/2
* // | |
* // | 0,0 |
* // | |
* // -width/2,height/2 ----------- width/2,height/2
* pointLight(250, 250, 250, locX, locY, 50);
* noStroke();
* sphere(40);
Expand Down Expand Up @@ -632,16 +632,16 @@ p5.prototype.lightFalloff = function(
* }
* function draw() {
* background(0);
* //move your mouse to change light position
* // move your mouse to change light position
* let locX = mouseX - width / 2;
* let locY = mouseY - height / 2;
* // to set the light position,
* // think of the world's coordinate as:
* // -width/2,-height/2 -------- width/2,-height/2
* // | |
* // | 0,0 |
* // | |
* // -width/2,height/2--------width/2,height/2
* // -width/2,-height/2 ----------- width/2,-height/2
* // | |
* // | 0,0 |
* // | |
* // -width/2,height/2 ----------- width/2,height/2
* ambientLight(50);
* spotLight(0, 250, 0, locX, locY, 100, 0, 0, -1, Math.PI / 16);
* noStroke();
Expand Down