Skip to content
Merged
Changes from all commits
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
13 changes: 11 additions & 2 deletions src/webgl/p5.Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ class Camera {
* // Point the camera at the origin.
* cam.lookAt(0, 0, 0);
*
* // Set the camera.
* setCamera(cam);
*
* describe(
* 'A white cube on a gray background. The text "eyeY: -400" is written in black beneath it.'
* );
Expand All @@ -180,7 +183,7 @@ class Camera {
* fill(0);
*
* // Display the value of eyeY, rounded to the nearest integer.
* text(`eyeX: ${round(cam.eyeY)}`, 0, 55);
* text(`eyeY: ${round(cam.eyeY)}`, 0, 55);
* }
* </code>
* </div>
Expand Down Expand Up @@ -2197,6 +2200,9 @@ class Camera {
* // Point it at the origin.
* cam.lookAt(0, 0, 0);
*
* // Set the camera.
* setCamera(cam);
*
* describe(
* 'A white cube drawn against a gray background. The cube appears to move when the user presses certain keys.'
* );
Expand Down Expand Up @@ -2450,6 +2456,9 @@ class Camera {
* // Copy cam1's configuration.
* cam2.set(cam1);
*
* // Set the camera.
* setCamera(cam2);
*
* describe(
* 'A white cube drawn against a gray background. The camera slowly moves forward. The camera resets when the user double-clicks.'
* );
Expand Down Expand Up @@ -3458,7 +3467,7 @@ function camera(p5, fn){
if (!(this._renderer instanceof RendererGL)) {
throw new Error('linePerspective() must be called in WebGL mode.');
}
this._renderer.linePerspective(enable);
return this._renderer.linePerspective(enable);
};


Expand Down