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

WebGL mode documentation improvements #6167

Merged
merged 19 commits into from
Jun 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
11 changes: 11 additions & 0 deletions src/core/shape/2d_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,17 @@ p5.prototype._renderEllipse = function(x, y, w, h, detailX) {
* </code>
* </div>
*
* <div>
* <code>
* createCanvas(100, 100, WEBGL);
* strokeWeight(7);
* line(0, 0, 0, 30, 0, 0);
* line(0, 0, 0, 0, 30, 0);
* line(-30, -30, -30, 30, 30, 30);
* describe('two lines mark the flat x and y axes while a third line spans diagonally through the third dimension');
* </code>
* </div>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other code examples only used the x and y parameters for line(), so I added one using the z parameters for WEBGL mode.

I figure it's a good goal to show all the possible parameters in the code examples, which would mean having a 3D example for the 2D primitives.

Having these scaffolded examples might naturally help users transition to WEBGL. Eg. they might know the WEBGL coordinate system is different just from their time browsing 2D primitives examples.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, it's nice to see the webGL versions with the updated signatures! If we don't think it's too much code I think it could be nice to color these lines in rgb (xyz) gizmo fashion like so https://editor.p5js.org/aferriss/sketches/qCsZ08lJ8

*
*/

/**
Expand Down