-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
docs(src/webgl): Use describe()
instead of @alt
#5599
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,18 +33,11 @@ import * as constants from '../core/constants'; | |
* function draw() { | ||
* background(200); | ||
* plane(50, 50); | ||
* describe(`A white plane (shaped like a square). | ||
* Black lines show that the plane is built from 2 triangles.`); | ||
* } | ||
* </code> | ||
* </div> | ||
* | ||
* @alt | ||
* Nothing displayed on canvas | ||
* Rotating interior view of a box with sides that change color. | ||
* 3d red and green gradient. | ||
* Rotating interior view of a cylinder with sides that change color. | ||
* Rotating view of a cylinder with sides that change color. | ||
* 3d red and green gradient. | ||
* rotating view of a multi-colored cylinder with concave sides. | ||
*/ | ||
p5.prototype.plane = function(width, height, detailX, detailY) { | ||
this._assert3d('plane'); | ||
|
@@ -121,6 +114,7 @@ p5.prototype.plane = function(width, height, detailX, detailY) { | |
* rotateX(frameCount * 0.01); | ||
* rotateY(frameCount * 0.01); | ||
* box(50); | ||
* describe(`Rotating view of a 3D box with sides of length 50.`); | ||
* } | ||
* </code> | ||
* </div> | ||
|
@@ -239,6 +233,9 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { | |
* function draw() { | ||
* background(205, 102, 94); | ||
* sphere(40); | ||
* describe(`A white sphere with a diameter of 40. | ||
* Black lines on its surface show how the sphere is built out of | ||
* many small triangles.`); | ||
* } | ||
* </code> | ||
* </div> | ||
|
@@ -262,6 +259,12 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { | |
* background(205, 105, 94); | ||
* rotateY(millis() / 1000); | ||
* sphere(40, detailX.value(), 16); | ||
* describe(`A rotating shape, resembling a clam shell or | ||
* “flattened” sphere, with white surface and a diameter of 40. | ||
* The shape is built from many small triangles, which each have | ||
* a black stroke to visually isolate. | ||
* Below the drawing is a slider. Increasing it adds more | ||
* triangles, such that the overall shape becomes rounder as the slider approaches its maximum.`); | ||
* } | ||
* </code> | ||
* </div> | ||
|
@@ -285,6 +288,15 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { | |
* background(205, 105, 94); | ||
* rotateY(millis() / 1000); | ||
* sphere(40, 16, detailY.value()); | ||
* describe(`A white rotating sphere-like shape with a diameter of 40. | ||
* Its actual shape is like a cylinder with the top and bottom | ||
* surface protruding outward. | ||
* Black lines on its surface show how the sphere is built out of | ||
* many small triangles. | ||
* When adjusting the slider below the drawing, the shape increases | ||
* the number of small triangles making up the sphere, making the | ||
* final shape increasingly round as the slider approaches its | ||
* maximum setting.`); | ||
* } | ||
* </code> | ||
* </div> | ||
|
@@ -458,6 +470,9 @@ const _truncatedCone = function( | |
* rotateX(frameCount * 0.01); | ||
* rotateZ(frameCount * 0.01); | ||
* cylinder(20, 50); | ||
* describe(`A spinning view of a white cylinder. | ||
* Black lines on its surface show how the cylinder is built out of | ||
* many small triangles.`); | ||
* } | ||
* </code> | ||
* </div> | ||
|
@@ -481,6 +496,11 @@ const _truncatedCone = function( | |
* background(205, 105, 94); | ||
* rotateY(millis() / 1000); | ||
* cylinder(20, 75, detailX.value(), 1); | ||
* describe(`A spinning view of what appears to be a white plane. | ||
* Black lines on its surface show how the shape is built out of | ||
* many small triangles. | ||
* As you increase the slider below the canvas, the shape gradually | ||
* becomes smoother and closer to a cylinder.`); | ||
Comment on lines
+499
to
+503
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make description more succinct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same response as my first comment. |
||
* } | ||
* </code> | ||
* </div> | ||
|
@@ -504,6 +524,12 @@ const _truncatedCone = function( | |
* background(205, 105, 94); | ||
* rotateY(millis() / 1000); | ||
* cylinder(20, 75, 16, detailY.value()); | ||
* describe(`A spinning view of a white cylinder. | ||
* Black lines on its surface show how the shape is built out of | ||
* many small triangles. | ||
* As you increase the slider below the canvas, the shape increases | ||
* the number of triangles on the outer (round) surface, but the | ||
* smoothness of the shape remains the same.`); | ||
Comment on lines
+527
to
+532
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make description more succinct? For instance: a spinning white cylinder with its surface made of small triangles, the slider below the canvas modifies the number of triangles on the shape. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same response as my first comment. |
||
* } | ||
* </code> | ||
* </div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,12 +39,11 @@ import * as constants from '../core/constants'; | |
* orbitControl(); | ||
* rotateY(0.5); | ||
* box(30, 50); | ||
* describe(`Camera orbits around a box when mouse moved while | ||
* holding the button down.`); | ||
* } | ||
* </code> | ||
* </div> | ||
* | ||
* @alt | ||
* Camera orbits around a box when mouse is hold-clicked & then moved. | ||
*/ | ||
|
||
// implementation based on three.js 'orbitControls': | ||
|
@@ -183,14 +182,14 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { | |
* if (keyIsDown(32)) { | ||
* noDebugMode(); | ||
* } | ||
* describe(`a 3D box is centered on a grid in a 3D sketch. | ||
* an icon indicates the direction of each axis: | ||
* a red line points +X, a green line +Y, and a blue line +Z. | ||
* the grid and icon disappear when the spacebar is pressed.`); | ||
Comment on lines
+185
to
+188
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make more succinct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same response as my first comment. |
||
* } | ||
* </code> | ||
* </div> | ||
* @alt | ||
* a 3D box is centered on a grid in a 3D sketch. an icon | ||
* indicates the direction of each axis: a red line points +X, | ||
* a green line +Y, and a blue line +Z. the grid and icon disappear when the | ||
* spacebar is pressed. | ||
* | ||
* | ||
* @example | ||
* <div> | ||
|
@@ -207,11 +206,10 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { | |
* background(200); | ||
* orbitControl(); | ||
* box(15, 30); | ||
* describe(`a 3D box is centered on a grid in a 3D sketch.`); | ||
* } | ||
* </code> | ||
* </div> | ||
* @alt | ||
* a 3D box is centered on a grid in a 3D sketch. | ||
* | ||
* @example | ||
* <div> | ||
|
@@ -230,13 +228,12 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { | |
* background(200); | ||
* orbitControl(); | ||
* box(15, 30); | ||
* describe(`a 3D box is centered in a 3D sketch. | ||
* an icon indicates the direction of each axis: | ||
* a red line points +X, a green line +Y, and a blue line +Z.`); | ||
* } | ||
* </code> | ||
* </div> | ||
* @alt | ||
* a 3D box is centered in a 3D sketch. an icon | ||
* indicates the direction of each axis: a red line points +X, | ||
* a green line +Y, and a blue line +Z. | ||
* | ||
* @example | ||
* <div> | ||
|
@@ -253,11 +250,10 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { | |
* background(200); | ||
* orbitControl(); | ||
* box(15, 30); | ||
* describe(`a 3D box is centered on a grid in a 3D sketch`); | ||
* } | ||
* </code> | ||
* </div> | ||
* @alt | ||
* a 3D box is centered on a grid in a 3D sketch | ||
* | ||
* @example | ||
* <div> | ||
|
@@ -280,13 +276,12 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { | |
* // set the stroke color and weight for the grid! | ||
* stroke(255, 0, 150); | ||
* strokeWeight(0.8); | ||
* describe(`a 3D box is centered on a grid in a 3D sketch. | ||
* an icon indicates the direction of each axis: | ||
* a red line points +X, a green line +Y, and a blue line +Z.`); | ||
* } | ||
* </code> | ||
* </div> | ||
* @alt | ||
* a 3D box is centered on a grid in a 3D sketch. an icon | ||
* indicates the direction of each axis: a red line points +X, | ||
* a green line +Y, and a blue line +Z. | ||
*/ | ||
|
||
/** | ||
|
@@ -388,14 +383,13 @@ p5.prototype.debugMode = function(...args) { | |
* if (keyIsDown(32)) { | ||
* noDebugMode(); | ||
* } | ||
* describe(`a 3D box is centered on a grid in a 3D sketch. | ||
* an icon indicates the direction of each axis: | ||
* a red line points +X, a green line +Y, and a blue line +Z. | ||
* the grid and icon disappear when the spacebar is pressed.`); | ||
Comment on lines
+386
to
+389
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make it more succinct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same response as my first comment. |
||
* } | ||
* </code> | ||
* </div> | ||
* @alt | ||
* a 3D box is centered on a grid in a 3D sketch. an icon | ||
* indicates the direction of each axis: a red line points +X, | ||
* a green line +Y, and a blue line +Z. the grid and icon disappear when the | ||
* spacebar is pressed. | ||
*/ | ||
p5.prototype.noDebugMode = function() { | ||
this._assert3d('noDebugMode'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, can we try to make it more succinct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same response as my first comment.