new getCamera function for V1 & V2
Open
@ombalgude is already working on this.
Since Sep 23, 2025.
Area:WebGL
Feature Request
Good First Issue
Help Wanted
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Increasing access
It would provide compatability between versions 1 & 2 but more importantly provide users and library creators a standard method to access, modify and set cameras.
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
- Internationalization
- Friendly errors
- Other (specify if possible)
Feature request details
I suggest a new function for both V1 and V2 that returns a reference to the current camera object, something like
// V2
RendererGL.prototype.getCamera = function(cam) {
return this.states.setValue('curCamera', cam);
}
// V1
RendererGL.prototype.getCamera = function(cam) {
return this._curCamera;
}
This would provide compatibility between versions.
Additional comment:
I see that in version 2.0.5 the createCamera method still sets the newly created camera as the default. See issues
5941, 7077 and 7102
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.