-
-
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
Addresses issue #6519 #6532
Addresses issue #6519 #6532
Changes from 3 commits
00b13ff
716732f
e8d6626
4dc77be
9eb1671
fa7b5ef
850d94f
9033c26
b420f8e
d662e48
e508b44
9d478f3
7ad21af
fe9e39a
e6d6901
e445663
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 |
---|---|---|
|
@@ -127,16 +127,31 @@ p5.prototype.camera = function (...args) { | |
* vertical field of view, aspect ratio (usually width/height), and near and far | ||
* clipping planes. | ||
* | ||
* If no parameters are given, the following default is used: | ||
* perspective(PI/3, width/height, eyeZ/10, eyeZ*10), | ||
* where eyeZ is equal to ((height/2) / tan(PI/6)). | ||
* If no parameters are given, the default values are used, with a fixed location and a variable field of view. | ||
* @method perspective | ||
* @for p5 | ||
* @param {Number} [fovy] camera frustum vertical field of view, | ||
* from bottom to top of view, in <a href="#/p5/angleMode">angleMode</a> units | ||
* @param {Number} [aspect] camera frustum aspect ratio | ||
* @param {Number} [near] frustum near plane length | ||
* @param {Number} [far] frustum far plane length | ||
* @param {Number} [fovy] - camera frustum vertical field of view, | ||
* from bottom to top of view, in <a href="#/p5/angleMode">angleMode</a> units. | ||
* The default value is now variable and based on the canvas size as: | ||
* this.defaultEyeZ = 800; | ||
* defaultCameraFOV = 2 * Math.atan(this._renderer.height / 2 / this.defaultEyeZ); | ||
* | ||
* @param {Number} [aspect] camera frustum aspect ratio .The default value = this._renderer.width / this._renderer.height; | ||
* @param {Number} [near] frustum near plane length or the near clipping plane. The default value = this.defaultEyeZ * 0.1; | ||
* @param {Number} [far] frustum far plane length or the far clipping plane. The default value = this.defaultEyeZ * 10; | ||
* | ||
* However,If you prefer a fixed field of view, you can use the old defaults: | ||
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. Rather than referring to these as the old defaults, we can motivate why someone might want to do this by starting with "If you want a fixed field of view". To ensure that you can see |
||
* | ||
* - Field of view: PI/3 (60 degrees) | ||
* - Canvas aspect ratio: width / height | ||
* - Near clipping plane: eyeZ / 10 | ||
* - Far clipping plane: eyeZ * 10 | ||
* | ||
* @example | ||
* Set a fixed field of view | ||
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. Was this intended to be a new example with code? 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.
yes my bad , I thought of providing a separate example for the perspective function's syntax with the old default values. But now , i think there's no need of a separate example for this. I 'll just remove this one. |
||
* perspective(PI/3, width / height, eyeZ / 10, eyeZ * 10); | ||
* where eyeZ is equal to ((height/2) / tan(PI/6)). | ||
* | ||
* @chainable | ||
* @example | ||
* <div> | ||
|
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.
Instead of writing this as code, maybe we can write what's going on in plain English? i.e. we pick a field of view that ensures you can see exactly
width
pixels across horizontally andheight
pixels across vertically 800 units away from the camera.