Skip to content

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

@davepagurek

Description

@davepagurek

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.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

DONE! 🎉

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions