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

perspective() documentation needs updating now that the default field of view is different #6519

Closed
1 of 17 tasks
davepagurek opened this issue Nov 2, 2023 · 5 comments
Closed
1 of 17 tasks

Comments

@davepagurek
Copy link
Contributor

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

main branch

Web browser and version

N/A

Operating System

N/A

Steps to reproduce this

In the reference for perspective(), we say:

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)).

This is no longer the case: now, the default eyeZ camera field of view is this:

p5.js/src/webgl/p5.Camera.js

Lines 1952 to 1954 in 6b7c511

this.defaultEyeZ = 800;
this.defaultCameraFOV =
2 * Math.atan(this._renderer.height / 2 / this.defaultEyeZ);

We should mention that we use a fixed location and variable field of view. The default values currently documented shouldn't be fully removed though: if one wants a fixed field of view, we can suggest using those defaults instead.

@Abjcodes
Copy link

Abjcodes commented Nov 4, 2023

Hey @davepagurek, Can I work on this?

@davepagurek
Copy link
Contributor Author

Thanks @Abjcodes, go ahead!

@Garima3110
Copy link
Member

Hey @Abjcodes any update on working on this issue. ? Please let me know if I can help you in any way in addressing this issue.
Thankyou!

@Abjcodes
Copy link

Abjcodes commented Nov 6, 2023

Hey @davepagurek & @Garima3110. I am not able to locate the documentation file to which the changes are to be made. Can you help me out to locate the file? Thank you.

@Garima3110
Copy link
Member

Hey @davepagurek & @Garima3110. I am not able to locate the documentation file to which the changes are to be made. Can you help me out to locate the file? Thank you.

Well, I think the changes need to be made in the inline documentation written in this file only.

src/webgl/p5.Camera.js

@davepagurek Please correct me if I am wrong.

@Garima3110 Garima3110 mentioned this issue Nov 6, 2023
3 tasks
Garima3110 added a commit to Garima3110/p5.js that referenced this issue Nov 11, 2023
@Garima3110 Garima3110 mentioned this issue Nov 11, 2023
3 tasks
davepagurek added a commit that referenced this issue Nov 23, 2023
@davepagurek davepagurek moved this from Documentation to DONE! 🎉 in p5.js WebGL Projects Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: DONE! 🎉
Development

No branches or pull requests

3 participants